@@ -11,34 +11,41 @@ bundle remove actionmailer || true
11
11
bundle remove rails || true
12
12
bundle add rails --skip-install ${RAILSOPTS:- }
13
13
bundle install --prefer-local
14
+ bundle exec rails -v
14
15
15
16
# do our work a directory with spaces in the name (#176, #184)
16
17
rm -rf " My Workspace"
17
18
mkdir " My Workspace"
18
19
pushd " My Workspace"
19
20
20
- # create a rails app
21
- bundle exec rails -v
21
+ function prepare_deps {
22
+ # make sure to use the same version of rails (e.g., install from git source if necessary)
23
+ bundle remove rails --skip-install
24
+ bundle add rails --skip-install ${RAILSOPTS:- }
25
+
26
+ # use the tailwindcss-rails under test
27
+ bundle add tailwindcss-rails --skip-install --path=" ../.."
28
+ bundle add tailwindcss-ruby --skip-install ${TAILWINDCSSOPTS:- }
29
+ bundle install --prefer-local
30
+ bundle show --paths | fgrep tailwind
31
+ bundle binstubs --all
32
+ }
33
+
34
+ function install_tailwindcss {
35
+ # install tailwindcss
36
+ bin/rails tailwindcss:install
37
+
38
+ # TEST: tailwind was installed correctly
39
+ grep -q " <main class=\" container" app/views/layouts/application.html.erb
40
+ test -a app/assets/tailwind/application.css
41
+ }
42
+
43
+ # Application variation #1 ----------------------------------------
22
44
bundle exec rails new test-install --skip-bundle
23
45
pushd test-install
24
46
25
- # make sure to use the same version of rails (e.g., install from git source if necessary)
26
- bundle remove rails --skip-install
27
- bundle add rails --skip-install ${RAILSOPTS:- }
28
-
29
- # use the tailwindcss-rails under test
30
- bundle add tailwindcss-rails --skip-install --path=" ../.."
31
- bundle add tailwindcss-ruby --skip-install ${TAILWINDCSSOPTS:- }
32
- bundle install --prefer-local
33
- bundle show --paths | fgrep tailwind
34
- bundle binstubs --all
35
-
36
- # install tailwindcss
37
- bin/rails tailwindcss:install
38
-
39
- # TEST: tailwind was installed correctly
40
- grep -q " <main class=\" container" app/views/layouts/application.html.erb
41
- test -a app/assets/tailwind/application.css
47
+ prepare_deps
48
+ install_tailwindcss
42
49
43
50
# TEST: rake tasks don't exec (#188)
44
51
cat << EOF >> Rakefile
@@ -73,4 +80,17 @@ grep -q "py-2" app/assets/builds/tailwind.css
73
80
# TEST: contents include application.css directives
74
81
grep -q " #abc12399" app/assets/builds/tailwind.css
75
82
83
+ # Application variation #2 ----------------------------------------
84
+ popd
85
+ bundle exec rails new test-install2 --skip-bundle --skip-system-test
86
+ pushd test-install2
87
+
88
+ prepare_deps
89
+ install_tailwindcss
90
+
91
+ # TEST: presence of the generated file
92
+ # TEST: nothing blew up without system tests, https://github.com/rails/tailwindcss-rails/issues/559
93
+ bin/rails generate scaffold post title:string body:text published:boolean
94
+ grep -q " Show" app/views/posts/index.html.erb
95
+
76
96
echo " OK"
0 commit comments