Sha256: 4268d5fce9f34093ba8e82a3793f1ce82f21912f47d5bda8d302da69dab4127b

Contents?: true

Size: 439 Bytes

Versions: 1

Compression:

Stored size: 439 Bytes

Contents

require 'spec_helper'

describe 'String#surround' do

  context 'given one arg' do
    it 'surrounds the string with the arg' do
      'foo'.surround('bar').should == 'barfoobar'
    end
  end

  context 'given two args' do
    it 'prepends the first arg' do
      'bar'.surround('foo', 'baz').should match(/^foobar/)
    end
    it 'appends the second arg' do
      'bar'.surround('foo', 'baz').should match(/barbaz$/)
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gists-0.0.1 spec/surround_spec.rb