spec/lib/hotcell/context_spec.rb in hotcell-0.2.0 vs spec/lib/hotcell/context_spec.rb in hotcell-0.3.0

- old
+ new

@@ -1,10 +1,10 @@ require 'spec_helper' describe Hotcell::Context do its('scope.scope') { should == [{}] } - its(:helpers) { should be_a Hotcell::Manipulator } + its(:helpers) { should be_a Hotcell::Tong } describe '#normalize_options' do def result options = {} default = { scope: {}, shared: {}, helpers: [], reraise: false, rescuer: described_class::DEFAULT_RESCUER } default.merge options @@ -67,11 +67,11 @@ subject { described_class.new(rescuer: ->(e){ "Rescued from: #{e.class}" }) } specify { subject.safe { 3 * 'foo' }.should =~ /Rescued from: TypeError/ } end end - describe '#manipulator_invoke' do + describe '#tong_invoke' do subject { described_class.new( variables: { foo: 42, 'bar' => 'baz' }, environment: { 'baz' => 'moo' }, helpers: Module.new do def strip string string.strip @@ -80,14 +80,14 @@ def bar 'bazzzzz' end end ) } - specify { subject.manipulator_invoke('foo').should == 42 } - specify { subject.manipulator_invoke('moo').should be_nil } - specify { subject.manipulator_invoke('baz').should be_nil } - specify { subject.manipulator_invoke('bar').should == 'baz' } - specify { expect { subject.manipulator_invoke('bar', 42) }.to raise_error ArgumentError } - specify { expect { subject.manipulator_invoke('strip') }.to raise_error ArgumentError } - specify { subject.manipulator_invoke('strip', ' hello ').should == 'hello' } + specify { subject.tong_invoke('foo').should == 42 } + specify { subject.tong_invoke('moo').should be_nil } + specify { subject.tong_invoke('baz').should be_nil } + specify { subject.tong_invoke('bar').should == 'baz' } + specify { expect { subject.tong_invoke('bar', 42) }.to raise_error ArgumentError } + specify { expect { subject.tong_invoke('strip') }.to raise_error ArgumentError } + specify { subject.tong_invoke('strip', ' hello ').should == 'hello' } end end