Sha256: 6e5a906472f3bc59c6af3146e8e2511d57c83134a5a84021aff1a1808afdb05d

Contents?: true

Size: 341 Bytes

Versions: 29

Compression:

Stored size: 341 Bytes

Contents

describe "String#start_with?" do
  it "returns true only if beginning match" do
    s = "hello"
    s.start_with?('h').should be_true
    s.start_with?('hel').should be_true
    s.start_with?('el').should be_false
  end

  it "returns true only if any beginning match" do
    "hello".start_with?('x', 'y', 'he', 'z').should be_true
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

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