free_mutant/spec/integration/mutant/loader_spec.rb
Markus Schirp 42e6fe84e5 Add runner with reporter
* Use MethodObject mixin
* Rename Context::Constant to Context::Scope
* Use Mutation class instead of passing around raw nodes
2012-08-16 04:10:54 +02:00

21 lines
564 B
Ruby

require 'spec_helper'
class CodeLoadingSubject
def x
true
end
end
describe Mutant, 'code loading' do
let(:context) { Mutant::Context::Scope.build(CodeLoadingSubject,"/some/path") }
let(:node) { 'def foo; :bar; end'.to_ast }
let(:root) { context.root(node) }
subject { Mutant::Loader.run(root) }
before { subject }
it 'should add the method to subject' do
CodeLoadingSubject.new.foo.should be(:bar)
end
end