Add specs for Subject::Method::Instance#public?

This commit is contained in:
Markus Schirp 2014-11-17 21:16:25 +00:00
parent 23bf4d2bd6
commit f172318203

View file

@ -85,6 +85,34 @@ RSpec.describe Mutant::Subject::Method::Instance do
it { should eql("def foo\nend") }
end
describe '#public?' do
subject { object.public? }
context 'when method is public' do
it { should be(true) }
end
context 'when method is private' do
before do
scope.class_eval do
private :foo
end
end
it { should be(false) }
end
context 'when method is protected' do
before do
scope.class_eval do
protected :foo
end
end
it { should be(false) }
end
end
end
RSpec.describe Mutant::Subject::Method::Instance::Memoized do