2012-07-26 19:25:23 +02:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2012-07-31 04:10:37 +02:00
|
|
|
describe Mutant::Matcher::Method, '#context' do
|
2012-07-26 19:25:23 +02:00
|
|
|
subject { object.context }
|
|
|
|
|
2012-07-31 04:10:37 +02:00
|
|
|
let(:object) { described_class::Singleton.new('SampleSubjects::ExampleModule', 'foo') }
|
2012-07-26 19:25:23 +02:00
|
|
|
let(:context) { mock('Context') }
|
|
|
|
|
|
|
|
before do
|
|
|
|
Mutant::Context::Constant.stub(:build => context)
|
|
|
|
end
|
|
|
|
|
|
|
|
it { should be(context); }
|
|
|
|
|
|
|
|
it 'should build context with subject' do
|
|
|
|
Mutant::Context::Constant.should_receive(:build).with(::SampleSubjects::ExampleModule).and_return(context)
|
|
|
|
should be(context)
|
|
|
|
end
|
|
|
|
|
|
|
|
it_should_behave_like 'an idempotent method'
|
|
|
|
end
|