Sha256: dcc5546e17f8ff294d2b0bcc2c73ab7d5c6489d66984da69bcf2c9b89387527c

Contents?: true

Size: 998 Bytes

Versions: 12

Compression:

Stored size: 998 Bytes

Contents

require 'spec_helper'

describe Mutant::Loader::Eval, '.run' do

  subject { object.run(node, mutation_subject) }

  let(:object)           { described_class                                             }
  let(:mutation_subject) { mock('Subject', :source_path => path, :source_line => line) }
  let(:path)             { 'test.rb'                                                   }
  let(:line)             { 1                                                           }

  let(:source) do
    <<-RUBY
      class SomeNamespace
        class Bar
          def some_method
          end
        end

        class SomeOther
          class Foo < Bar
          end
        end
      end
    RUBY
  end

  let(:node) do
    parse(source)
  end

  it 'should load nodes into vm' do
    subject
    ::SomeNamespace::SomeOther::Foo
  end

  it 'should set file and line correctly' do
    subject
    ::SomeNamespace::Bar.instance_method(:some_method).source_location.should eql(['test.rb', 3])
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
mutant-0.3.0.beta13 spec/unit/mutant/loader/eval/class_methods/run_spec.rb
mutant-0.3.0.beta12 spec/unit/mutant/loader/eval/class_methods/run_spec.rb
mutant-0.3.0.beta11 spec/unit/mutant/loader/eval/class_methods/run_spec.rb
mutant-0.3.0.beta10 spec/unit/mutant/loader/eval/class_methods/run_spec.rb
mutant-0.3.0.beta9 spec/unit/mutant/loader/eval/class_methods/run_spec.rb
mutant-0.3.0.beta8 spec/unit/mutant/loader/eval/class_methods/run_spec.rb
mutant-0.3.0.beta7 spec/unit/mutant/loader/eval/class_methods/run_spec.rb
mutant-0.3.0.beta6 spec/unit/mutant/loader/eval/class_methods/run_spec.rb
mutant-0.3.0.beta5 spec/unit/mutant/loader/eval/class_methods/run_spec.rb
mutant-0.3.0.beta4 spec/unit/mutant/loader/eval/class_methods/run_spec.rb
mutant-0.3.0.beta3 spec/unit/mutant/loader/eval/class_methods/run_spec.rb
mutant-0.3.0.beta2 spec/unit/mutant/loader/eval/class_methods/run_spec.rb