Sha256: d48ae82d911a2fef8090c00cb125ea0f09e954a6f301e1c75fe15e9520fa4846

Contents?: true

Size: 782 Bytes

Versions: 13

Compression:

Stored size: 782 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Mutant::Context::Scope, '#root' do
  subject { object.root(node) }

  let(:object) { described_class.new(TestApp::Literal, path) }
  let(:path)   { double('Path')                              }
  let(:node)   { parse(':node')                              }

  let(:scope)      { subject.body }
  let(:scope_body) { scope.body   }

  let(:expected_source) do
    generate(parse(<<-RUBY))
      module TestApp
        class Literal
          :node
        end
      end
    RUBY
  end

  let(:generated_source) do
    Unparser.unparse(subject)
  end

  let(:round_tripped_source) do
    Unparser.unparse(parse(expected_source))
  end

  it 'should create correct source' do
    generated_source.should eql(expected_source)
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
mutant-0.3.6 spec/unit/mutant/context/scope/root_spec.rb
mutant-0.3.5 spec/unit/mutant/context/scope/root_spec.rb
mutant-0.3.4 spec/unit/mutant/context/scope/root_spec.rb
mutant-0.3.3 spec/unit/mutant/context/scope/root_spec.rb
mutant-0.3.2 spec/unit/mutant/context/scope/root_spec.rb
mutant-0.3.1 spec/unit/mutant/context/scope/root_spec.rb
mutant-0.3.0 spec/unit/mutant/context/scope/root_spec.rb
mutant-0.3.0.rc5 spec/unit/mutant/context/scope/root_spec.rb
mutant-0.3.0.rc4 spec/unit/mutant/context/scope/root_spec.rb
mutant-0.3.0.rc3 spec/unit/mutant/context/scope/root_spec.rb
mutant-0.3.0.rc2 spec/unit/mutant/context/scope/root_spec.rb
mutant-0.3.0.rc1 spec/unit/mutant/context/scope/root_spec.rb
mutant-0.3.0.beta22 spec/unit/mutant/context/scope/root_spec.rb