Created
February 13, 2012 13:07
-
-
Save codesnik/1816831 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'rspec' | |
def includes | |
end | |
def includes_only | |
end | |
describe "#includes" do | |
it "should be true for equal lists" do | |
includes( ['SVO'], ['SVO'] ).should == true | |
end | |
specify { includes( ['SVO', 'CDG'], ['DME', 'SVO'] ).should == true } | |
specify { includes( ['SVO', 'CDG'], ['DME'] ).should == false } | |
pending { includes( 'SVO', 'SVO' ).should == true } | |
pending { includes( 'SVO CDG', 'SVO' ).should == true } | |
pending { includes( 'SVO CDG', 'DME SVO' ).should == true } | |
end | |
describe "#includes_only" do | |
it "should be true for equal lists" do | |
includes_only( ['SVO'], ['SVO'] ).should == true | |
end | |
it "should be true when first set is a subset of second set" do | |
includes_only( ['SVO'], ['SVO', 'DME'] ).should == true | |
end | |
it "should be false when second set is only a partial subset of first set" do | |
includes_only( ['SVO', 'DME'], ['SVO'] ).should == true | |
end | |
specify { includes_only( ['SVO', 'CDG'], ['DME', 'SVO'] ).should == false } | |
specify { includes_only( ['SVO', 'CDG', 'SVO'], ['CDG', 'SVO'] ).should == true } | |
specify { includes_only( ['SVO', 'CDG'], ['DME'] ).should == false } | |
pending { includes_only( 'SVO', 'SVO' ).should == true } | |
pending { includes_only( 'SVO CDG SVO', 'SVO CDG' ).should == true } | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment