Sha256: 89d7cb99d826914f7eb5a2662e2392d278cf2ef0ad0a8d499b0b3f64bcfccc47

Contents?: true

Size: 528 Bytes

Versions: 2

Compression:

Stored size: 528 Bytes

Contents

require 'spec_helper'

describe Range do

  describe "#include_with_range?" do
    it "to be true" do
      expect((1..5).include_with_range?(1..5)).to eq(true)
      expect((1..5).include_with_range?(2..3)).to eq(true)
    end

    it "to be false" do
      expect((1..5).include_with_range?(2..6)).to eq(false)
    end
  end

  describe "#overlaps?" do
    it "to be true" do
      expect((1..5).overlaps?(4..6)).to eq(true)
    end

    it "to be false" do
      expect((1..5).overlaps?(7..9)).to eq(false)
    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
active_object-1.1.1 spec/lib/range_spec.rb
active_object-1.1.0 spec/lib/range_spec.rb