free_mutant/spec/unit/mutant/class_methods/not_implemented_spec.rb
Markus Schirp dc893bfd7d Progress on method matching
* Adjust metrics
* Add initial integration spec on method matching
* Yard and Heckle coverage is at 100% (heckle cov is disputable)
* Rcov does not really make sense as MRI 1.8 cannot reach all code
  paths.
2012-07-24 01:41:08 +02:00

35 lines
743 B
Ruby

require 'spec_helper'
describe Mutant,'.not_implemented' do
let(:object) { described_class.new }
let(:described_class) do
Class.new do
def foo
Mutant.not_implemented(self)
end
def self.foo
Mutant.not_implemented(self)
end
def self.name
'Test'
end
end
end
context 'on instance method' do
subject { object.foo }
it 'should raise error' do
expect { subject }.to raise_error(NotImplementedError,'Test#foo is not implemented')
end
end
context 'on singleton method' do
subject { described_class.foo }
it 'should raise error' do
expect { subject }.to raise_error(NotImplementedError,'Test.foo is not implemented')
end
end
end