free_mutant/spec/unit/mutant/context/scope/unqualified_name_spec.rb
Dan Kubb 2c6934f146 Change deprecated mock() to double()
* Fix code alignment
2013-07-14 10:01:30 -07:00

27 lines
644 B
Ruby

require 'spec_helper'
describe Mutant::Context::Scope, '#unqualified_name' do
subject { object.unqualified_name }
let(:path) { double('Path') }
context 'with top level constant name' do
let(:object) { described_class.new(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.new(TestApp::Literal, path) }
it 'should return the unqualified name' do
should eql('Literal')
end
it_should_behave_like 'an idempotent method'
end
end