Sha256: ba03a60db55df8129813bc2f98ea05010649311e699301c8e0d0aff2ba40ce6c

Contents?: true

Size: 1.03 KB

Versions: 21

Compression:

Stored size: 1.03 KB

Contents

require File.expand_path("#{File.dirname(__FILE__)}/../../spec_helper")

describe Range do
  include WildcardMatcherMatchers

  describe '#wildcard_match?' do
    subject { 1..5 }

    it "returns true when given Range is exactly equal to this Range" do
      should wildcard_match(1..5)
    end

    it "returns true when given number falls within the range" do
      should wildcard_match(3)
    end

    it "returns false when given number falls outside the range" do
      should_not wildcard_match(8)
    end
  end

  describe '#==' do
    subject { 1..5 }

    it "returns true when given Range is exactly equal to this Range" do
      should equal_match(1..5)
    end

    it "returns false when given Range is not exactly equal to this Range" do
      should_not equal_match(3..5)
    end

    it "returns false even when given an object that wildcard matches this Range" do
      should_not equal_match(3)
    end

    it "returns false when given object isn't even a Range" do
      should_not equal_match(:something_else)
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
rr-3.1.1 spec/suites/rspec_2/unit/core_ext/range_spec.rb
rr-3.1.0 spec/suites/rspec_2/unit/core_ext/range_spec.rb
rr-3.0.9 spec/suites/rspec_2/unit/core_ext/range_spec.rb
rr-3.0.8 spec/suites/rspec_2/unit/core_ext/range_spec.rb
rr-3.0.7 spec/suites/rspec_2/unit/core_ext/range_spec.rb
rr-3.0.6 spec/suites/rspec_2/unit/core_ext/range_spec.rb
rr-3.0.5 spec/suites/rspec_2/unit/core_ext/range_spec.rb
rr-3.0.4 spec/suites/rspec_2/unit/core_ext/range_spec.rb
rr-3.0.3 spec/suites/rspec_2/unit/core_ext/range_spec.rb
rr-3.0.2 spec/suites/rspec_2/unit/core_ext/range_spec.rb
rr-3.0.1 spec/suites/rspec_2/unit/core_ext/range_spec.rb
rr-3.0.0 spec/suites/rspec_2/unit/core_ext/range_spec.rb
rr-1.2.1 spec/suites/rspec_2/unit/core_ext/range_spec.rb
rr-1.2.0 spec/suites/rspec_2/unit/core_ext/range_spec.rb
rr-1.1.2 spec/suites/rspec_2/unit/core_ext/range_spec.rb
rr-1.1.2.rc1 spec/suites/rspec_2/unit/core_ext/range_spec.rb
rr-1.1.1.rc1 spec/suites/rspec_2/unit/core_ext/range_spec.rb
rr-1.1.0 spec/suites/rspec_2/unit/core_ext/range_spec.rb
rr-1.1.0.rc3 spec/suites/rspec_2/unit/core_ext/range_spec.rb
rr-1.1.0.rc2 spec/suites/rspec_2/unit/core_ext/range_spec.rb