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

Allow mutant:disable to apply to inline macros and visibility modifiers #1399

Open
dgollahon opened this issue Aug 3, 2023 · 0 comments
Open

Comments

@dgollahon
Copy link
Sponsor Collaborator

class MutantExample
  private

  # mutant:disable
  public def demo
    {}.freeze
  end
end
RSpec.describe MutantExample do
  it 'is a hash' do
    expect(described_class.new.demo).to be_a(Hash)
  end
end

The above produces an alive mutation (see #1398) but if I change the public modifier to not be inline, the mutant:disable does work:

class MutantExample
  private

  # mutant:disable
  def demo
    {}.freeze
  end
  public :demo
end

Note that I care about this beyond just private, protected, and public. I have some macros (like memoize) where I would prefer to use it in an inline fashion rather than repeating the name of the method below the method in the macro.

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

No branches or pull requests

1 participant