Skip to content

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

Open
@dgollahon

Description

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions