Sha256: ea45338a5ba6f7d4e5b8e1e58f8414b8cbbe9f3d416f63ea3d30e8a3c06cc979
Contents?: true
Size: 983 Bytes
Versions: 40
Compression:
Stored size: 983 Bytes
Contents
require 'lib/ramaze/spec/helper/snippets' describe 'Array#put_within' do it 'should put a given object at a well-described position' do array = [:foo, :bar, :baz] array.put_within(:foobar, :after => :bar, :before => :baz) array.should == [:foo, :bar, :foobar, :baz] end it 'should raise on uncertainity' do array = [:foo, :bar, :baz] lambda{ array.put_within(:foobar, :after => :foo, :before => :baz) }.should.raise(ArgumentError). message.should == "Too many elements within constrain" end end describe 'Array#put_after' do it 'should put a given object at a well-described position' do array = [:foo, :bar, :baz] array.put_after(:bar, :foobar) array.should == [:foo, :bar, :foobar, :baz] end end describe 'Array#put_within' do it 'should put a given object at a well-described position' do array = [:foo, :bar, :baz] array.put_before(:bar, :foobar) array.should == [:foo, :foobar, :bar, :baz] end end
Version data entries
40 entries across 40 versions & 6 rubygems