From 1b65924e73414f9b8bd657fbf8e779077fc613b2 Mon Sep 17 00:00:00 2001 From: Markus Schirp Date: Tue, 27 Nov 2018 13:03:23 +0000 Subject: [PATCH] Change location of limitations docs --- README.md | 55 +-------------------------------------------- docs/limitations.md | 50 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 54 deletions(-) create mode 100644 docs/limitations.md diff --git a/README.md b/README.md index ee889ee1..79653ce1 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ Topics * [Nomenclature](/docs/nomenclature.md) * [Reading Reports](/docs/reading-reports.md) * [Known Problems](/docs/known-problems.md) +* [Limitations](/docs/limitations.md) Sponsoring ---------- @@ -75,54 +76,6 @@ You can control some aspects of RSpec using the `SPEC_OPTS` environment variable SPEC_OPTS="--pattern spec/subdir_only/**/*_spec.rb" bundle exec mutant --use rspec SomeClass ``` -Limitations ------------ - -Mutant cannot emit mutations for... - -* methods defined within a closure. For example, methods defined using `module_eval`, `class_eval`, - `define_method`, or `define_singleton_method`: - - ```ruby - class Example - class_eval do - def example1 - end - end - - module_eval do - def example2 - end - end - - define_method(:example3) do - end - - define_singleton_method(:example4) do - end - end - ``` - -* singleton methods not defined on a constant or `self` - - ```ruby - class Foo - def self.bar; end # ok - def Foo.baz; end # ok - - myself = self - def myself.qux; end # cannot mutate - end - ``` - -* methods defined with eval: - - ```ruby - class Foo - class_eval('def bar; end') # cannot mutate - end - ``` - Mutation-Operators ------------------ @@ -131,12 +84,6 @@ The `mutant-meta` is arranged to the AST-Node-Types of parser. Refer to parsers There is no easy and universal way to count the number of mutation operators a tool supports. -Subjects --------- - -Mutant currently mutates code in instance and singleton methods. It is planned to support mutation -of constant definitions and domain specific languages, DSL probably as plugins. - Test-Selection -------------- diff --git a/docs/limitations.md b/docs/limitations.md new file mode 100644 index 00000000..18117706 --- /dev/null +++ b/docs/limitations.md @@ -0,0 +1,50 @@ +Limitations +=========== + +Subject +------- + +Mutant cannot emit mutations for some subjects. + +* methods defined within a closure. For example, methods defined using `module_eval`, `class_eval`, + `define_method`, or `define_singleton_method`: + + ```ruby + class Example + class_eval do + def example1 + end + end + + module_eval do + def example2 + end + end + + define_method(:example3) do + end + + define_singleton_method(:example4) do + end + end + ``` + +* singleton methods not defined on a constant or `self` + + ```ruby + class Foo + def self.bar; end # ok + def Foo.baz; end # ok + + myself = self + def myself.qux; end # cannot mutate + end + ``` + +* methods defined with eval: + + ```ruby + class Foo + class_eval('def bar; end') # cannot mutate + end + ```