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

Exclude methods defined in lexical scope of class_eval / instance_eval / *_eval from automated subject matching. #254

Closed
mbj opened this issue Sep 16, 2014 · 0 comments

Comments

@mbj
Copy link
Owner

mbj commented Sep 16, 2014

When mutating an active record based project I found alive mutants that cannot easily be killed.

Models got alive mutants in:
https://github.com/rails/rails/blob/v4.1.5/activerecord/lib/active_record/associations/builder/belongs_to.rb#L31-L70

Mutations for these methods inside *_eval bodies in block form are not correctly inserted via monkeypatching. There might be a chance to do this but it is unlikely such code is a valid mutation subject for an app using active record.

Such methods should IMO be unit tested / covered form the library, NOT from the clients code. So it'll probably be saved to exclude them from mutation from client.

mbj added a commit that referenced this issue Sep 16, 2014
* No easy way to insert mutants on these via current monkey patching
  loader
* The blocks are typically part of a method building library when those
  libraries are mutated the def/defs nodes will be part of an mutated
  block that is included in a subject.

[fix #254]
mbj added a commit that referenced this issue Sep 16, 2014
* No easy way to insert mutants on these via current monkey patching
  loader
* The blocks are typically part of a method building library when those
  libraries are mutated the def/defs nodes will be part of an mutated
  block that is included in a subject.

[fix #254]
mbj added a commit that referenced this issue Sep 16, 2014
* No easy way to insert mutants on these via current monkey patching
  loader
* The blocks are typically part of a method building library when those
  libraries are mutated the def/defs nodes will be part of an mutated
  block that is included in a subject.

[fix #254]
@mbj mbj closed this as completed in a2de044 Sep 16, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant