Skip to content

Commit

Permalink
Fix: naming conflict when running "test"
Browse files Browse the repository at this point in the history
  • Loading branch information
AlanCornthwaiteKatalyst committed May 13, 2024
1 parent aecb45b commit be19c12
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions spec/generators/koi/active_record_generator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@

RSpec.describe Koi::ActiveRecordGenerator do
subject(:output) do
gen = generator(%w(test title:string slug:string content:rich_text))
gen = generator(%w(resource title:string slug:string content:rich_text))
Ammeter::OutputCapturer.capture(:stdout) { gen.invoke_all }
end

it "runs the expected creation steps" do
expect(output.lines.grep(/create/).map { |l| l.split.last }).to contain_exactly(
"app/models/test.rb",
%r{db/migrate/\d+_create_tests.rb},
"spec/factories/tests.rb",
"spec/models/test_spec.rb",
"app/models/resource.rb",
%r{db/migrate/\d+_create_resources.rb},
"spec/factories/resources.rb",
"spec/models/resource_spec.rb",
)
end

it "creates the expected files" do
output
expect(Pathname.new(file("app/models/test.rb"))).to exist
expect(Pathname.new(migration_file("db/migrate/create_tests.rb"))).to exist
expect(Pathname.new(file("spec/models/test_spec.rb"))).to exist
expect(Pathname.new(file("app/models/resource.rb"))).to exist
expect(Pathname.new(migration_file("db/migrate/create_resources.rb"))).to exist
expect(Pathname.new(file("spec/models/resource_spec.rb"))).to exist
end
end
2 changes: 1 addition & 1 deletion spec/generators/koi/admin_generator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

RSpec.describe Koi::AdminGenerator do
subject(:output) do
gen = generator(%w(test title:text content:rich_text))
gen = generator(%w(resource title:text content:rich_text))
Ammeter::OutputCapturer.capture(:stdout) { gen.invoke_all }
end

Expand Down

0 comments on commit be19c12

Please sign in to comment.