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

Update ammeter (to a temporary repo) to support RSpec 4 #2468

Closed
wants to merge 1 commit into from

Conversation

pirj
Copy link
Member

@pirj pirj commented Feb 20, 2021

ammeter is rspec-rails's development dependency, used to test generators.
Its runtime contains code that is not compatible with the latest changes in RSpec 4 (unification of metadata multi-condition filtering), making rspec-core's rspec-rails sub-build to fail.

    c.include Ammeter::RSpec::Rails::GeneratorExampleGroup,
      :type          => :generator,
      :file_path     => lambda { |file_path, metadata|
        metadata[:type].nil? && generator_path_regex =~ file_path
      }

This is a temporary measure to use ammeter's patched fork until the patch is accepted and a newer version is released.

See

@pirj
Copy link
Member Author

pirj commented Feb 20, 2021

Alternatively, we could just add the following to our spec/spec_helper.rb until ammeter is updated:

    c.include Ammeter::RSpec::Rails::GeneratorExampleGroup,
      :type          => :generator
    c.include Ammeter::RSpec::Rails::GeneratorExampleGroup,
      :file_path     => lambda { |file_path, metadata|
        metadata[:type].nil? && generator_path_regex =~ file_path
      }

pirj added a commit that referenced this pull request Feb 20, 2021
See:

- rspec/rspec-core#1821
- rspec/rspec-core#2874
- alexrothenberg/ammeter#64
- example failure (Ammeter::RSpec::Rails::GeneratorExampleGroup that defines destination is not included) https://github.com/rspec/rspec-core/pull/2874/checks?check_run_id=1942170588

Alternative to #2468
pirj added a commit that referenced this pull request Feb 20, 2021
See:

- rspec/rspec-core#1821
- rspec/rspec-core#2874
- alexrothenberg/ammeter#64
- example failure (Ammeter::RSpec::Rails::GeneratorExampleGroup that defines destination is not included) https://github.com/rspec/rspec-core/pull/2874/checks?check_run_id=1942170588

Alternative to #2468
pirj added a commit that referenced this pull request Feb 20, 2021
See:

- rspec/rspec-core#1821
- rspec/rspec-core#2874
- alexrothenberg/ammeter#64
- example failure (Ammeter::RSpec::Rails::GeneratorExampleGroup that defines destination is not included) https://github.com/rspec/rspec-core/pull/2874/checks?check_run_id=1942170588

Alternative to #2468
@pirj
Copy link
Member Author

pirj commented Feb 21, 2021

I like the other approach better. And my suspicion is that we'll have to live longer with the patch, as ammeter doesn't seem to be actively maintained. Depending on my fork of it in the long run would be just weird.

@pirj pirj closed this Feb 21, 2021
@pirj pirj deleted the update-ammeter-to-support-rspec-4 branch February 21, 2021 13:39
pirj added a commit that referenced this pull request Feb 22, 2021
See:

- rspec/rspec-core#1821
- rspec/rspec-core#2874
- alexrothenberg/ammeter#64
- example failure (Ammeter::RSpec::Rails::GeneratorExampleGroup that defines destination is not included) https://github.com/rspec/rspec-core/pull/2874/checks?check_run_id=1942170588

Alternative to #2468
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