Sha256: 8fbdc91340ec51a323631c518ca25626008504da9bcf953ed9aa9b1c892d0aef

Contents?: true

Size: 646 Bytes

Versions: 5

Compression:

Stored size: 646 Bytes

Contents

require 'spec_helper'

describe Mutant::Context::Scope, '#unqualified_name' do
  subject { object.unqualified_name }

  let(:path)   { mock('Path') }

  context 'with top level constant name' do
    let(:object) { described_class.build(TestApp, path) }

    it 'should return the unqualified name' do
      should eql('TestApp')
    end

    it_should_behave_like 'an idempotent method'
  end

  context 'with scoped constant name' do
    let(:object) { described_class.build(TestApp::Literal, path) }

    it 'should return the unqualified name' do
      should eql('Literal')
    end

    it_should_behave_like 'an idempotent method'
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
mutant-0.2.4 spec/unit/mutant/context/scope/unqualified_name_spec.rb
mutant-0.2.3 spec/unit/mutant/context/scope/unqualified_name_spec.rb
mutant-0.2.2 spec/unit/mutant/context/scope/unqualified_name_spec.rb
mutant-0.2.1 spec/unit/mutant/context/scope/unqualified_name_spec.rb
mutant-0.2.0 spec/unit/mutant/context/scope/unqualified_name_spec.rb