Skip to content

Commit 82cfd43

Browse files
committed
Avoid over-constraining the pretend-mode generator spec
1 parent ebd026f commit 82cfd43

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

react_on_rails/spec/react_on_rails/generators/install_generator_spec.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4760,14 +4760,13 @@ class ActiveSupport::TestCase
47604760

47614761
it "does not chmod copied bin scripts in pretend mode" do
47624762
allow(install_generator).to receive(:directory)
4763+
allow(install_generator).to receive(:copy_file).and_call_original
47634764
allow(install_generator).to receive(:use_rsc?).and_return(false)
47644765
shakapacker_watch_template = File.expand_path(
47654766
"../../../lib/generators/react_on_rails/templates/base/base/bin/shakapacker-watch",
47664767
__dir__
47674768
)
47684769

4769-
expect(install_generator).to receive(:copy_file)
4770-
.with(shakapacker_watch_template, "bin/shakapacker-watch")
47714770
expect(install_generator).to receive(:say_status)
47724771
.with(:gsub, "bin/dev", true)
47734772
.twice
@@ -4777,6 +4776,9 @@ class ActiveSupport::TestCase
47774776
expect(File).not_to receive(:chmod)
47784777

47794778
install_generator.send(:add_bin_scripts)
4779+
4780+
expect(install_generator).to have_received(:copy_file)
4781+
.with(shakapacker_watch_template, "bin/shakapacker-watch")
47804782
end
47814783

47824784
it "does not install typescript dependencies in pretend mode" do

0 commit comments

Comments
 (0)