Skip to content

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
pirj added a commit that referenced this pull request Feb 20, 2021
pirj added a commit that referenced this pull request Feb 20, 2021
@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
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