Sha256: b8d2ae5fc6a33890825bb555ed40ddaa6e2339ddc580e4636850d84eb1d8d344

Contents?: true

Size: 631 Bytes

Versions: 8

Compression:

Stored size: 631 Bytes

Contents

require 'spec_helper'

describe 'String#remove_suffix' do
  it 'removes a suffix in a string' do
    expect('Ladies Night'.remove_suffix(' Night')).to eq('Ladies')
  end

  it 'returns the original string if the parameter is not a suffix' do
    expect('Ladies Night'.remove_suffix('Ladies')).to eq('Ladies Night')
  end
end

describe 'String#remove_suffix!' do
  it 'removes a suffix in a string' do
    expect('Ladies Night'.remove_suffix!(' Night')).to eq('Ladies')
  end

  it 'returns the original string if the parameter is not a suffix' do
    expect('Ladies Night'.remove_suffix!('Ladies')).to eq('Ladies Night')
  end
end

Version data entries

8 entries across 6 versions & 4 rubygems

Version Path
powerpack-0.1.3 spec/powerpack/string/remove_suffix_spec.rb
config_gems_initialization_aim-0.1.4 vendor/bundle/ruby/2.5.0/gems/config_gems_initialization_aim-0.1.1/vendor/bundle/ruby/2.5.0/gems/powerpack-0.1.2/spec/powerpack/string/remove_suffix_spec.rb
config_gems_initialization_aim-0.1.4 vendor/bundle/ruby/2.5.0/gems/powerpack-0.1.2/spec/powerpack/string/remove_suffix_spec.rb
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/config_gems_initialization_aim-0.1.1/vendor/bundle/ruby/2.5.0/gems/powerpack-0.1.2/spec/powerpack/string/remove_suffix_spec.rb
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/powerpack-0.1.2/spec/powerpack/string/remove_suffix_spec.rb
dirwatch-0.0.9 vendor/bundle/ruby/2.5.0/gems/powerpack-0.1.2/spec/powerpack/string/remove_suffix_spec.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/powerpack-0.1.2/spec/powerpack/string/remove_suffix_spec.rb
powerpack-0.1.2 spec/powerpack/string/remove_suffix_spec.rb