2012-07-26 13:25:23 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2012-08-15 22:10:54 -04:00
|
|
|
describe Mutant::Context::Scope, '#unqualified_name' do
|
2012-07-26 13:25:23 -04:00
|
|
|
subject { object.unqualified_name }
|
|
|
|
|
2013-07-14 13:01:30 -04:00
|
|
|
let(:path) { double('Path') }
|
2012-07-26 13:25:23 -04:00
|
|
|
|
2012-08-14 06:26:56 -04:00
|
|
|
context 'with top level constant name' do
|
2012-12-12 16:11:35 -05:00
|
|
|
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'
|
2012-07-26 13:25:23 -04:00
|
|
|
end
|
|
|
|
|
2012-08-14 06:26:56 -04:00
|
|
|
context 'with scoped constant name' do
|
2012-12-12 16:11:35 -05:00
|
|
|
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
|
2012-07-26 13:25:23 -04:00
|
|
|
end
|