Sha256: 4c06149324ffb5442bbf74bd90dd71722a701416a84cc6f5e7aecc25e1c6a8f7

Contents?: true

Size: 493 Bytes

Versions: 25

Compression:

Stored size: 493 Bytes

Contents

describe "String#swapcase" do
  it "returns a new string with all uppercase chars from self converted to lowercase and vice versa" do
    "Hello".swapcase.should == "hELLO"
    "cYbEr_PuNk11".swapcase.should == "CyBeR_pUnK11"
    "+++---111222???".swapcase.should == "+++---111222???"
  end

  it "is locale insensitive (only upcases a-z and only downcases A-Z" do
    "ÄÖÜ".swapcase.should == "ÄÖÜ"
    "ärger".swapcase.should == "äRGER"
    "BÄR".swapcase.should == "bÄr"
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
opal-0.4.4 spec/rubyspec/core/string/swapcase_spec.rb
opal-0.4.3 spec/rubyspec/core/string/swapcase_spec.rb
opal-0.4.2 spec/rubyspec/core/string/swapcase_spec.rb
opal-0.4.1 spec/rubyspec/core/string/swapcase_spec.rb
opal-0.4.0 spec/rubyspec/core/string/swapcase_spec.rb
opal-0.3.44 spec/rubyspec/core/string/swapcase_spec.rb
opal-0.3.43 spec/rubyspec/core/string/swapcase_spec.rb
opal-0.3.42 spec/core/string/swapcase_spec.rb
opal-0.3.41 spec/core/string/swapcase_spec.rb
opal-0.3.40 spec/core/string/swapcase_spec.rb
opal-0.3.39 spec/core/string/swapcase_spec.rb
opal-0.3.38 spec/core/string/swapcase_spec.rb
opal-0.3.37 spec/core/string/swapcase_spec.rb
opal-0.3.36 spec/core/string/swapcase_spec.rb
opal-0.3.35 spec/core/string/swapcase_spec.rb
opal-0.3.34 spec/core/string/swapcase_spec.rb
opal-0.3.33 spec/core/string/swapcase_spec.rb
opal-0.3.32 spec/core/string/swapcase_spec.rb
opal-0.3.31 spec/core/string/swapcase_spec.rb
opal-0.3.30 spec/core/string/swapcase_spec.rb