Sha256: f9ee860b99fa75e6e9dff196f9dbde88224331c530ebd09f18ff4a36b9ccf823
Contents?: true
Size: 564 Bytes
Versions: 11
Compression:
Stored size: 564 Bytes
Contents
require "#{File.dirname(__FILE__)}/../screw_unit_spec_helper" describe Array do describe "#starts_with?" do it "returns true only for arrays that share a common prefix with the receiver" do a = ["foo", "bar", "baz"] a.starts_with?(["foo"]).should be_true a.starts_with?(["foo", "bar"]).should be_true a.starts_with?(["foo", "bar", "baz"]).should be_true a.starts_with?(["foo", "bar", "baz", "quux"]).should_not be_true a.starts_with?(["quux"]).should_not be_true a.starts_with?([]).should be_true end end end
Version data entries
11 entries across 11 versions & 1 rubygems