Skip to content

Commit

Permalink
Replace failing spec with passing one in smoke test
Browse files Browse the repository at this point in the history
The generated spec file intentionally has a failing spec in it, so gem
authors write specs.
If we are to use running specs as a way to check if the generator works,
then we need to make that spec pass.
  • Loading branch information
sambostock committed Feb 4, 2023
1 parent adfa027 commit 990ee11
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions smoke/smoke.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@

gemspec_path.write gemspec

spec_path = gem_dir / "spec/rubocop/#{gem_name.split('-').last}_spec.rb"
spec = spec_path.read
spec.sub!('expect(false).to eq(true)', 'expect(true).to eq(true)')

spec_path.write spec

system('bundle', 'install', exception: true, chdir: gem_dir)
system('bundle', 'exec', 'rake', 'new_cop[Smoke/Foo]', exception: true, chdir: gem_dir)
system('bundle', 'exec', 'rake', 'spec', exception: true, chdir: gem_dir)
Expand Down

0 comments on commit 990ee11

Please sign in to comment.