Skip to content

Commit

Permalink
fix generators test, thor always report "File unchanged" with -p option
Browse files Browse the repository at this point in the history
  • Loading branch information
scambra committed Nov 20, 2020
1 parent d352175 commit 7777c1d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/generators_test.rb
Expand Up @@ -17,13 +17,14 @@ class GeneratorsTest < ActiveSupport::TestCase

test "rails g devise_invitable:install" do
@output = `cd #{RAILS_APP_PATH} && rails g devise_invitable:install -p`
assert @output.match(%r{(inject|insert).* config/initializers/devise\.rb\n})
puts @output
assert @output.match(%r{(inject|insert|File unchanged! The supplied flag value not found!).* config/initializers/devise\.rb\n})
assert @output.match(%r|create.* config/locales/devise_invitable\.en\.yml\n|)
end

test "rails g devise_invitable Octopussy" do
@output = `cd #{RAILS_APP_PATH} && rails g devise_invitable Octopussy -p`
assert @output.match(%r{(inject|insert).* app/models/octopussy\.rb\n})
assert @output.match(%r{(inject|insert|File unchanged! The supplied flag value not found!).* app/models/octopussy\.rb\n})
assert @output.match(%r|invoke.* #{DEVISE_ORM}\n|)
if DEVISE_ORM == :active_record
assert @output.match(%r|create.* db/migrate/\d{14}_devise_invitable_add_to_octopussies\.rb\n|)
Expand Down

0 comments on commit 7777c1d

Please sign in to comment.