Fix coverage of Mutant::AST namespace
This commit is contained in:
parent
6d8f28e1cf
commit
68e485e0e3
1 changed files with 12 additions and 2 deletions
|
@ -42,8 +42,18 @@ RSpec.describe Mutant::AST::NamedChildren do
|
|||
end
|
||||
|
||||
describe '#bar' do
|
||||
it 'returns named child bar' do
|
||||
expect(instance.bar).to be(node_bar)
|
||||
context 'when node is present' do
|
||||
it 'returns named child bar' do
|
||||
expect(instance.bar).to be(node_bar)
|
||||
end
|
||||
end
|
||||
|
||||
context 'when node is NOT present' do
|
||||
let(:node) { s(:node, node_foo) }
|
||||
|
||||
it 'returns nil' do
|
||||
expect(instance.bar).to be(nil)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue