Skip to content

Commit

Permalink
Run generator inside destination root
Browse files Browse the repository at this point in the history
It is necessary to inform yarn what current directory should destination root.
  • Loading branch information
tricknotes committed Nov 9, 2017
1 parent 2128183 commit 5717da6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions spec/react_on_rails/support/generator_spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@ def run_generator_test_with_args(args, options = {})
simulate_npm_files(options)
yield if block_given?

# WARNING: std out is swallowed from running the generator during tests
run_generator(args + ["--ignore-warnings"])
Dir.chdir(destination_root) do
# WARNING: std out is swallowed from running the generator during tests
run_generator(args + ["--ignore-warnings"])
end
end

# Simulate having an existing file for cases where the generator needs to modify, not create, a file
Expand Down

0 comments on commit 5717da6

Please sign in to comment.