Sha256: caca1f4793ac941c4ba70af0d7adf00e6abcd47da2a0650b49e4aba0777529c0

Contents?: true

Size: 344 Bytes

Versions: 33

Compression:

Stored size: 344 Bytes

Contents

describe "String#partition" do
  it "returns an array of substrings based on splitting on the given string" do
    "hello world".partition("o").should == ["hell", "o", " world"]
  end

  it "always returns 3 elements" do
    "hello".partition("x").should == ["hello", "", ""]
    "hello".partition("hello").should == ["", "hello", ""]
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
opal-0.3.33 spec/core/string/partition_spec.rb
opal-0.3.32 spec/core/string/partition_spec.rb
opal-0.3.31 spec/core/string/partition_spec.rb
opal-0.3.30 spec/core/string/partition_spec.rb
opal-0.3.29 spec/core/string/partition_spec.rb
opal-0.3.28 spec/core/string/partition_spec.rb
opal-0.3.27 spec/core/string/partition_spec.rb
opal-0.3.26 spec/core/string/partition_spec.rb
opal-0.3.25 spec/core/string/partition_spec.rb
opal-0.3.22 spec/core/string/partition_spec.rb
opal-0.3.21 test/core/string/partition_spec.rb
opal-0.3.20 test/core/string/partition_spec.rb
opal-0.3.19 test/core/string/partition_spec.rb