Add specs for Subject::Method::Instance#public?
This commit is contained in:
parent
23bf4d2bd6
commit
f172318203
1 changed files with 28 additions and 0 deletions
|
@ -85,6 +85,34 @@ RSpec.describe Mutant::Subject::Method::Instance do
|
||||||
|
|
||||||
it { should eql("def foo\nend") }
|
it { should eql("def foo\nend") }
|
||||||
end
|
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
|
end
|
||||||
|
|
||||||
RSpec.describe Mutant::Subject::Method::Instance::Memoized do
|
RSpec.describe Mutant::Subject::Method::Instance::Memoized do
|
||||||
|
|
Loading…
Add table
Reference in a new issue