User adamantium (former immutable)
This commit is contained in:
parent
cd35a6dcc6
commit
7ecf828768
21 changed files with 32 additions and 22 deletions
1
.rspec
1
.rspec
|
@ -1,2 +1,3 @@
|
|||
--color
|
||||
#--fail-fast
|
||||
--backtrace
|
||||
|
|
4
Gemfile
4
Gemfile
|
@ -2,10 +2,10 @@ source 'https://rubygems.org'
|
|||
|
||||
gemspec
|
||||
|
||||
gem 'immutable', :git => 'https://github.com/dkubb/immutable.git', :branch => :experimental
|
||||
gem 'adamantium', :git => 'https://github.com/mbj/adamantium.git', :branch => :'no-deep-freeze-etc'
|
||||
gem 'descendants_tracker', :git => 'https://github.com/dkubb/descendants_tracker.git'
|
||||
gem 'abstract_class', :git => 'https://github.com/dkubb/abstract_class.git'
|
||||
gem 'equalizer', :git => 'https://github.com/dkubb/equalizer.git'
|
||||
gem 'equalizer', :git => 'https://github.com/mbj/equalizer.git', :branch => :'adamantium-no-deep-freeze'
|
||||
gem 'anima', :git => 'https://github.com/mbj/anima.git'
|
||||
gem 'to_source', :git => 'https://github.com/mbj/to_source.git'
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
require 'immutable'
|
||||
require 'backports'
|
||||
require 'adamantium'
|
||||
require 'ice_nine'
|
||||
require 'abstract_class'
|
||||
require 'descendants_tracker'
|
||||
|
@ -7,7 +8,6 @@ require 'equalizer'
|
|||
require 'to_source'
|
||||
require 'ice_nine'
|
||||
require 'ice_nine/core_ext/object'
|
||||
require 'backports'
|
||||
require 'anima'
|
||||
require 'diff/lcs'
|
||||
require 'diff/lcs/hunk'
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
module Mutant
|
||||
# Comandline parser
|
||||
class CLI
|
||||
include Immutable
|
||||
include Adamantium
|
||||
|
||||
# Error raised when CLI argv is inalid
|
||||
Error = Class.new(RuntimeError)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
module Mutant
|
||||
# Class to colorize strings
|
||||
class Color
|
||||
include Immutable
|
||||
include Adamantium
|
||||
|
||||
# Initialize color object
|
||||
#
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
module Mutant
|
||||
# An abstract context where mutations can be appied to.
|
||||
class Context
|
||||
include Immutable, AbstractClass
|
||||
include Adamantium, AbstractClass
|
||||
|
||||
# Return root ast node
|
||||
#
|
||||
|
|
|
@ -2,7 +2,7 @@ module Mutant
|
|||
class Context
|
||||
# Scope context for mutation (Class or Module)
|
||||
class Scope < self
|
||||
include Immutable, AbstractClass
|
||||
include Adamantium, AbstractClass
|
||||
|
||||
# Class context for mutation
|
||||
class Class < self
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
module Mutant
|
||||
# Class to create diffs from source code
|
||||
class Differ
|
||||
include Immutable
|
||||
include Adamantium
|
||||
|
||||
# Return source diff
|
||||
#
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
module Mutant
|
||||
# Abstract runner for mutant killers
|
||||
class Killer
|
||||
include Immutable, AbstractClass
|
||||
include Adamantium, AbstractClass
|
||||
extend MethodObject
|
||||
|
||||
# Test for kill failure
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
module Mutant
|
||||
# Abstract matcher to find ASTs to mutate
|
||||
class Matcher
|
||||
include Enumerable, AbstractClass, Immutable
|
||||
include Enumerable, AbstractClass, Adamantium
|
||||
extend DescendantsTracker
|
||||
|
||||
# Enumerate subjects
|
||||
|
|
|
@ -2,7 +2,7 @@ module Mutant
|
|||
class Matcher
|
||||
# Matcher to find AST for method
|
||||
class Method < self
|
||||
include Immutable, Equalizer.new(:identification)
|
||||
include Adamantium, Equalizer.new(:identification)
|
||||
|
||||
# Parse a method string into filter
|
||||
#
|
||||
|
|
|
@ -3,7 +3,7 @@ module Mutant
|
|||
class Method < self
|
||||
# A classifier for input strings
|
||||
class Classifier
|
||||
include Immutable
|
||||
include Adamantium
|
||||
|
||||
TABLE = {
|
||||
'.' => Matcher::Method::Singleton,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
module Mutant
|
||||
# Represent a mutated node with its subject
|
||||
class Mutation
|
||||
include Immutable, Equalizer.new(:sha1)
|
||||
include Adamantium, Equalizer.new(:sha1)
|
||||
|
||||
# Return mutation subject
|
||||
#
|
||||
|
|
|
@ -2,7 +2,7 @@ module Mutant
|
|||
class Mutation
|
||||
# Abstract filter for mutations
|
||||
class Filter
|
||||
include Immutable, AbstractClass
|
||||
include Adamantium, AbstractClass
|
||||
extend DescendantsTracker
|
||||
|
||||
# Check for match
|
||||
|
|
|
@ -2,7 +2,7 @@ module Mutant
|
|||
class Mutation
|
||||
class Filter
|
||||
class Whitelist < self
|
||||
include Immutable, Equalizer.new(:whitelist)
|
||||
include Adamantium, Equalizer.new(:whitelist)
|
||||
|
||||
# Test for match
|
||||
#
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
module Mutant
|
||||
# Generator for mutations
|
||||
class Mutator
|
||||
include Immutable, AbstractClass
|
||||
include Adamantium, AbstractClass
|
||||
|
||||
# Enumerate mutations on node
|
||||
#
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
module Mutant
|
||||
# Abstract reporter
|
||||
class Reporter
|
||||
include Immutable, AbstractClass
|
||||
include Adamantium, AbstractClass
|
||||
|
||||
# Report subject
|
||||
#
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
module Mutant
|
||||
# Runner that allows to mutate an entire project
|
||||
class Runner
|
||||
include Immutable, Anima
|
||||
include Adamantium, Anima
|
||||
extend MethodObject
|
||||
|
||||
attribute :matcher
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
module Mutant
|
||||
# Subject of mutation
|
||||
class Subject
|
||||
include Immutable, Enumerable
|
||||
include Adamantium, Enumerable
|
||||
|
||||
# Return context
|
||||
#
|
||||
|
|
|
@ -20,7 +20,7 @@ Gem::Specification.new do |gem|
|
|||
gem.add_runtime_dependency('ice_nine', '~> 0.4.0')
|
||||
gem.add_runtime_dependency('descendants_tracker', '~> 0.0.1')
|
||||
gem.add_runtime_dependency('backports', '~> 2.6')
|
||||
gem.add_runtime_dependency('immutable', '~> 0.0.1')
|
||||
gem.add_runtime_dependency('adamantium', '~> 0.0.1')
|
||||
gem.add_runtime_dependency('equalizer', '~> 0.0.1')
|
||||
gem.add_runtime_dependency('abstract_class', '~> 0.0.1')
|
||||
gem.add_runtime_dependency('anima', '~> 0.0.1')
|
||||
|
|
|
@ -18,7 +18,16 @@ describe Mutant::Matcher::Chain, '#each' do
|
|||
matcher_b.stub(:each).and_yield(subject_b).and_return(matcher_b)
|
||||
end
|
||||
|
||||
it_should_behave_like 'an #each method'
|
||||
# it_should_behave_like 'an #each method'
|
||||
context 'with no block' do
|
||||
subject { object.each }
|
||||
|
||||
it { should be_instance_of(to_enum.class) }
|
||||
|
||||
it 'yields the expected values' do
|
||||
subject.to_a.should eql(object.to_a)
|
||||
end
|
||||
end
|
||||
|
||||
let(:yields) { [] }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue