@@ -27,7 +27,7 @@ module ReactOnRails
2727
2828 before do
2929 allow ( Rails ) . to receive ( :root ) . and_return ( File . expand_path ( "." ) )
30- allow ( Webpacker ) . to receive_message_chain ( "config.public_output_path" )
30+ allow ( Shakapacker ) . to receive_message_chain ( "config.public_output_path" )
3131 . and_return ( webpacker_public_output_path )
3232 end
3333
@@ -75,70 +75,59 @@ module ReactOnRails
7575 end
7676
7777 describe ".build_production_command" do
78- context "when using Shakapacker 6 " do
78+ context "when using Shakapacker 7 " do
7979 before do
8080 allow ( ReactOnRails ::WebpackerUtils )
8181 . to receive ( "shakapacker_version" )
82- . and_return ( "6 .0.0" )
82+ . and_return ( "7 .0.0" )
8383 end
8484
85- it "fails when \" webpacker_precompile \" is truly and \" build_production_command\" is truly" do
86- allow ( Webpacker ) . to receive_message_chain ( "config.webpacker_precompile ?" )
85+ it "fails when \" shakapacker_precompile \" is truly and \" build_production_command\" is truly" do
86+ allow ( Shakapacker ) . to receive_message_chain ( "config.shakapacker_precompile ?" )
8787 . and_return ( true )
8888 expect do
8989 ReactOnRails . configure do |config |
90- config . build_production_command = "RAILS_ENV=production NODE_ENV=production bin/webpacker "
90+ config . build_production_command = "RAILS_ENV=production NODE_ENV=production bin/shakapacker "
9191 end
92- end . to raise_error ( ReactOnRails ::Error , /webpacker_precompile : false/ )
92+ end . to raise_error ( ReactOnRails ::Error , /shakapacker_precompile : false/ )
9393 end
9494
95- it "doesn't fail when \" webpacker_precompile \" is falsy and \" build_production_command\" is truly" do
96- allow ( Webpacker ) . to receive_message_chain ( "config.webpacker_precompile ?" )
95+ it "doesn't fail when \" shakapacker_precompile \" is falsy and \" build_production_command\" is truly" do
96+ allow ( Shakapacker ) . to receive_message_chain ( "config.shakapacker_precompile ?" )
9797 . and_return ( false )
9898 expect do
9999 ReactOnRails . configure do |config |
100- config . build_production_command = "RAILS_ENV=production NODE_ENV=production bin/webpacker "
100+ config . build_production_command = "RAILS_ENV=production NODE_ENV=production bin/shakapacker "
101101 end
102102 end . not_to raise_error
103103 end
104104
105- it "doesn't fail when \" webpacker_precompile \" is truly and \" build_production_command\" is falsy" do
106- allow ( Webpacker ) . to receive_message_chain ( "config.webpacker_precompile ?" )
105+ it "doesn't fail when \" shakapacker_precompile \" is truly and \" build_production_command\" is falsy" do
106+ allow ( Shakapacker ) . to receive_message_chain ( "config.shakapacker_precompile ?" )
107107 . and_return ( true )
108108 expect do
109109 ReactOnRails . configure { } # rubocop:disable-line Lint/EmptyBlock
110110 end . not_to raise_error
111111 end
112112
113- it "doesn't fail when \" webpacker_precompile \" is falsy and \" build_production_command\" is falsy" do
114- allow ( Webpacker ) . to receive_message_chain ( "config.webpacker_precompile ?" )
113+ it "doesn't fail when \" shakapacker_precompile \" is falsy and \" build_production_command\" is falsy" do
114+ allow ( Shakapacker ) . to receive_message_chain ( "config.shakapacker_precompile ?" )
115115 . and_return ( false )
116116 expect do
117117 ReactOnRails . configure { } # rubocop:disable-line Lint/EmptyBlock
118118 end . not_to raise_error
119119 end
120120 end
121121
122- context "when using Shakapacker 7 " do
122+ context "when using Shakapacker 8 " do
123123 before do
124124 allow ( ReactOnRails ::WebpackerUtils )
125125 . to receive ( "shakapacker_version" )
126- . and_return ( "7.0.0" )
127- end
128-
129- it "doesn't show deprecation message for webpacker_precompile?" do
130- allow ( Webpacker ) . to receive_message_chain ( "config.shakapacker_precompile?" )
131- . and_return ( false )
132-
133- expect do
134- ReactOnRails . configure do |config |
135- config . build_production_command = "RAILS_ENV=production NODE_ENV=production bin/shakapacker"
136- end
137- end . not_to output ( /Consider using `shakapacker_precompile?`/ ) . to_stdout
126+ . and_return ( "8.0.0" )
138127 end
139128
140129 it "fails when \" shakapacker_precompile\" is truly and \" build_production_command\" is truly" do
141- allow ( Webpacker ) . to receive_message_chain ( "config.shakapacker_precompile?" )
130+ allow ( Shakapacker ) . to receive_message_chain ( "config.shakapacker_precompile?" )
142131 . and_return ( true )
143132 expect do
144133 ReactOnRails . configure do |config |
@@ -148,7 +137,7 @@ module ReactOnRails
148137 end
149138
150139 it "doesn't fail when \" shakapacker_precompile\" is falsy and \" build_production_command\" is truly" do
151- allow ( Webpacker ) . to receive_message_chain ( "config.shakapacker_precompile?" )
140+ allow ( Shakapacker ) . to receive_message_chain ( "config.shakapacker_precompile?" )
152141 . and_return ( false )
153142 expect do
154143 ReactOnRails . configure do |config |
@@ -158,15 +147,15 @@ module ReactOnRails
158147 end
159148
160149 it "doesn't fail when \" shakapacker_precompile\" is truly and \" build_production_command\" is falsy" do
161- allow ( Webpacker ) . to receive_message_chain ( "config.shakapacker_precompile?" )
150+ allow ( Shakapacker ) . to receive_message_chain ( "config.shakapacker_precompile?" )
162151 . and_return ( true )
163152 expect do
164153 ReactOnRails . configure { } # rubocop:disable-line Lint/EmptyBlock
165154 end . not_to raise_error
166155 end
167156
168157 it "doesn't fail when \" shakapacker_precompile\" is falsy and \" build_production_command\" is falsy" do
169- allow ( Webpacker ) . to receive_message_chain ( "config.shakapacker_precompile?" )
158+ allow ( Shakapacker ) . to receive_message_chain ( "config.shakapacker_precompile?" )
170159 . and_return ( false )
171160 expect do
172161 ReactOnRails . configure { } # rubocop:disable-line Lint/EmptyBlock
0 commit comments