Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix smoke test and add workflow #20

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

sambostock
Copy link
Contributor

The smoke test was broken. This minimally fixes it, and adds a workflow to run it.

@@ -98,6 +98,7 @@ def self.defaults!
patch "lib/#{dirname}.rb", 'module Rubocop', 'module RuboCop'
patch "lib/#{dirname}/version.rb", 'module Rubocop', 'module RuboCop'
patch "#{name}.gemspec", 'Rubocop', 'RuboCop'
2.times { patch "spec/#{dirname}_spec.rb", 'Rubocop::', 'RuboCop::' }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I guess this is an actual bug fix, not just a smoke test fix. The smoke test found the bug, because it would blow up due to the constant being incorrect. See commit message for details.

@sambostock
Copy link
Contributor Author

I don't think the workflow will run on this branch, as it doesn't exist on master. It may be possible to manually trigger it, I'm not sure. Either way, I don't have access to do so.

The generated spec looks like

    RSpec.describe Rubocop::Smoke do
      it "has a version number" do
        expect(Rubocop::Smoke::VERSION).not_to be nil
      end

Because `patch` uses `sub`, not `gsub`, we must apply the patch twice,
to replace both occurences of `Rubocop` with `RuboCop`.
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.
The smoke test was broken. Putting it in a workflow ensures we find out
early if it happens again.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant