free_mutant/spec/unit/mutant/context/scope/unqualified_name_spec.rb

28 lines
642 B
Ruby
Raw Normal View History

require 'spec_helper'
describe Mutant::Context::Scope, '#unqualified_name' do
subject { object.unqualified_name }
let(:path) { mock('Path') }
2012-08-14 06:26:56 -04:00
context 'with top level constant name' do
let(:object) { described_class.new(TestApp, path) }
2012-08-14 06:26:56 -04:00
it 'should return the unqualified name' do
should eql('TestApp')
end
it_should_behave_like 'an idempotent method'
end
2012-08-14 06:26:56 -04:00
context 'with scoped constant name' do
let(:object) { described_class.new(TestApp::Literal, path) }
2012-08-14 06:26:56 -04:00
it 'should return the unqualified name' do
should eql('Literal')
end
it_should_behave_like 'an idempotent method'
end
end