Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions spec/synvert/core/rewriter/instance_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,63 +13,63 @@ module Synvert::Core

it 'parses within_node' do
scope = double()
block = Proc.new {}
block = proc {}
expect(Rewriter::WithinScope).to receive(:new).with(instance, { type: 'send', message: 'create' }, { recursive: true }, &block).and_return(scope)
expect(scope).to receive(:process)
instance.within_node(type: 'send', message: 'create', &block)
end

it 'parses with_node' do
scope = double()
block = Proc.new {}
block = proc {}
expect(Rewriter::WithinScope).to receive(:new).with(instance, { type: 'send', message: 'create' }, { recursive: true }, &block).and_return(scope)
expect(scope).to receive(:process)
instance.with_node(type: 'send', message: 'create', &block)
end

it 'parses within_direct_node' do
scope = double()
block = Proc.new {}
block = proc {}
expect(Rewriter::WithinScope).to receive(:new).with(instance, { type: 'send', message: 'create' }, { recursive: false }, &block).and_return(scope)
expect(scope).to receive(:process)
instance.within_direct_node(type: 'send', message: 'create', &block)
end

it 'parses with_direct_node' do
scope = double()
block = Proc.new {}
block = proc {}
expect(Rewriter::WithinScope).to receive(:new).with(instance, { type: 'send', message: 'create' }, { recursive: false }, &block).and_return(scope)
expect(scope).to receive(:process)
instance.with_direct_node(type: 'send', message: 'create', &block)
end

it 'parses goto_node' do
scope = double()
block = Proc.new {}
block = proc {}
expect(Rewriter::GotoScope).to receive(:new).with(instance, :caller, &block).and_return(scope)
expect(scope).to receive(:process)
instance.goto_node(:caller, &block)
end

it 'parses if_exist_node' do
condition = double()
block = Proc.new {}
block = proc {}
expect(Rewriter::IfExistCondition).to receive(:new).with(instance, type: 'send', message: 'create', &block).and_return(condition)
expect(condition).to receive(:process)
instance.if_exist_node(type: 'send', message: 'create', &block)
end

it 'parses unless_exist_node' do
condition = double()
block = Proc.new {}
block = proc {}
expect(Rewriter::UnlessExistCondition).to receive(:new).with(instance, type: 'send', message: 'create', &block).and_return(condition)
expect(condition).to receive(:process)
instance.unless_exist_node(type: 'send', message: 'create', &block)
end

it 'parses if_only_exist_node' do
condition = double()
block = Proc.new {}
block = proc {}
expect(Rewriter::IfOnlyExistCondition).to receive(:new).with(instance, type: 'send', message: 'create', &block).and_return(condition)
expect(condition).to receive(:process)
instance.if_only_exist_node(type: 'send', message: 'create', &block)
Expand Down