Skip to content

Instantly share code, notes, and snippets.

@jedschneider
Created June 24, 2011 20:15
Show Gist options
  • Select an option

  • Save jedschneider/1045585 to your computer and use it in GitHub Desktop.

Select an option

Save jedschneider/1045585 to your computer and use it in GitHub Desktop.
partial_date_spec.rb
require 'spec_helper'
RSpec::Matchers.define :be_included_in do |expected|
match do |actual|
actual.send(:includes?, expected) # => range.includes?("05-15")
end
end
describe PartialDateRange do
describe "a range that wraps the year end from 05-14 to 04-30" do
subject { PartialDateRange.new("05-14", "04-30") }
specify { should contain_the_date("05-15") }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment