Sha256: 2bb29951b753f86f91b35ed39cf2e899a6c07a80a86a3671a111919084d631e8

Contents?: true

Size: 1.29 KB

Versions: 25

Compression:

Stored size: 1.29 KB

Contents

# encoding: utf-8
#
# This file is part of the lazier gem. Copyright (C) 2013 and above Shogun <shogun_panda@me.com>.
# Licensed under the MIT license, which can be found at http://www.opensource.org/licenses/mit-license.php.
#

require "spec_helper"

describe Lazier::String do
  let(:reference) { "abc òùà èé &amp;gt;" }
  let(:translated_reference) { "abc oua ee &amp;gt;" }
  let(:untitleized_reference) { "abc-òùà-èé-&amp;gt;" }
  let(:amp_reference) { "abc òùà èé &gt;" }

  before(:all) do
    ::Lazier.load!
  end

  describe "#remove_accents" do
    it "should translate accents" do
      expect(reference.remove_accents).to eq(translated_reference)
    end
  end

  describe "#untitleize" do
    it "should convert spaces to dashes" do
      expect(reference.untitleize).to eq(untitleized_reference)
    end
  end

  describe "#replace_ampersands" do
    it "should remove HTML ampersands" do
      expect(reference.replace_ampersands).to eq(amp_reference)
    end
  end

  describe "#value" do
    it "should return the string itself" do
      expect(reference.value).to eq(reference)
      expect(translated_reference.value).to eq(translated_reference)
      expect(untitleized_reference.value).to eq(untitleized_reference)
      expect(amp_reference.value).to eq(amp_reference)
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
lazier-3.1.0 spec/lazier/string_spec.rb
lazier-3.0.1 spec/lazier/string_spec.rb
lazier-3.0.0 spec/lazier/string_spec.rb
lazier-2.8.1 spec/lazier/string_spec.rb
lazier-2.8.0 spec/lazier/string_spec.rb
lazier-2.7.0 spec/lazier/string_spec.rb
lazier-2.6.7 spec/lazier/string_spec.rb
lazier-2.6.6 spec/lazier/string_spec.rb
lazier-2.6.5 spec/lazier/string_spec.rb
lazier-2.6.4 spec/lazier/string_spec.rb
lazier-2.6.3 spec/lazier/string_spec.rb
lazier-2.6.2 spec/lazier/string_spec.rb
lazier-2.6.1 spec/lazier/string_spec.rb
lazier-2.5.3 spec/lazier/string_spec.rb
lazier-2.5.2 spec/lazier/string_spec.rb
lazier-2.5.1 spec/lazier/string_spec.rb
lazier-2.5.0 spec/lazier/string_spec.rb
lazier-2.4.0 spec/lazier/string_spec.rb
lazier-2.3.1 spec/lazier/string_spec.rb
lazier-2.3.0 spec/lazier/string_spec.rb