Sha256: a03b557dd3574a5b359c5453dd2986f9f5422140640583d9f363dc0d8805c52d

Contents?: true

Size: 564 Bytes

Versions: 5

Compression:

Stored size: 564 Bytes

Contents

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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
mutant-0.2.4 spec/integration/mutant/loader_spec.rb
mutant-0.2.3 spec/integration/mutant/loader_spec.rb
mutant-0.2.2 spec/integration/mutant/loader_spec.rb
mutant-0.2.1 spec/integration/mutant/loader_spec.rb
mutant-0.2.0 spec/integration/mutant/loader_spec.rb