001f3c7d99
* Add a Mutant::Loader::Eval that loads code via Kernel#eval * Move Mutnat::Loader to Mutant::Loader::Rubinius (currently not used)
21 lines
564 B
Ruby
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::Eval.run(root) }
|
|
|
|
before { subject }
|
|
|
|
it 'should add the method to subject' do
|
|
CodeLoadingSubject.new.foo.should be(:bar)
|
|
end
|
|
end
|