free_mutant/spec/integration/loader_spec.rb
Markus Schirp 69cda2fb14 Add first code loading integration spec
* The exact procedure of loading needs more
  care to be better understod.
* Fix problems found while loading.
2012-07-27 00:24:11 +02:00

23 lines
655 B
Ruby

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