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

Version Path
coolerator.vision-0.2.10 spec/support/vendor/screw-unit/spec/screw_unit/array_extension_spec.rb
coolerator.vision-0.2.9 spec/support/vendor/screw-unit/spec/screw_unit/array_extension_spec.rb
coolerator.vision-0.2.8 spec/support/vendor/screw-unit/spec/screw_unit/array_extension_spec.rb
coolerator.vision-0.2.7 spec/support/vendor/screw-unit/spec/screw_unit/array_extension_spec.rb
coolerator.vision-0.2.6 spec/support/vendor/screw-unit/spec/screw_unit/array_extension_spec.rb
coolerator.vision-0.2.5 spec/support/vendor/screw-unit/spec/screw_unit/array_extension_spec.rb
coolerator.vision-0.2.4 spec/support/vendor/screw-unit/spec/screw_unit/array_extension_spec.rb
coolerator.vision-0.2.3 spec/support/vendor/screw-unit/spec/screw_unit/array_extension_spec.rb
coolerator.vision-0.2.2 spec/support/vendor/screw-unit/spec/screw_unit/array_extension_spec.rb
coolerator.vision-0.2.1 spec/support/vendor/screw-unit/spec/screw_unit/array_extension_spec.rb
coolerator.vision-0.2.0 spec/support/vendor/screw-unit/spec/screw_unit/array_extension_spec.rb