2012-07-26 19:25:23 +02:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2012-08-16 04:10:54 +02:00
|
|
|
describe Mutant::Context::Scope, '#unqualified_name' do
|
2012-07-26 19:25:23 +02:00
|
|
|
subject { object.unqualified_name }
|
|
|
|
|
2012-08-16 04:10:54 +02:00
|
|
|
let(:path) { mock('Path') }
|
2012-07-26 19:25:23 +02:00
|
|
|
|
2012-08-14 12:26:56 +02:00
|
|
|
context 'with top level constant name' do
|
2012-12-12 22:11:35 +01:00
|
|
|
let(:object) { described_class.new(TestApp, path) }
|
2012-08-14 12:26:56 +02:00
|
|
|
|
|
|
|
it 'should return the unqualified name' do
|
|
|
|
should eql('TestApp')
|
|
|
|
end
|
|
|
|
|
|
|
|
it_should_behave_like 'an idempotent method'
|
2012-07-26 19:25:23 +02:00
|
|
|
end
|
|
|
|
|
2012-08-14 12:26:56 +02:00
|
|
|
context 'with scoped constant name' do
|
2012-12-12 22:11:35 +01:00
|
|
|
let(:object) { described_class.new(TestApp::Literal, path) }
|
2012-08-14 12:26:56 +02:00
|
|
|
|
|
|
|
it 'should return the unqualified name' do
|
|
|
|
should eql('Literal')
|
|
|
|
end
|
|
|
|
|
|
|
|
it_should_behave_like 'an idempotent method'
|
|
|
|
end
|
2012-07-26 19:25:23 +02:00
|
|
|
end
|