Skip to content

Commit

Permalink
modify the spec which related to Range.
Browse files Browse the repository at this point in the history
  • Loading branch information
Watson1978 authored and ferrous26 committed Nov 5, 2011
1 parent eed654e commit c6ae8ca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion spec/macruby/core/range_spec.rb
Expand Up @@ -11,7 +11,7 @@
it "responds to #relative_to, which returns a new Range object without negative indicies" do
( 0 .. 10).relative_to(11).should == (0..10)
( 1 .. 9 ).relative_to(11).should == (1..9 )
( 0 .. 15).relative_to(11).should == (0..10)
( 0 .. 15).relative_to(11).should == (0..11)

( 0 .. -1 ).relative_to(11).should == (0..10)
( 0 .. -2 ).relative_to(11).should == (0..9 )
Expand Down
8 changes: 4 additions & 4 deletions spec/macruby/language/objc_method_spec.rb
Expand Up @@ -368,12 +368,12 @@ def o2.to_str; 'foo' end
end

it "accepting a Range as a structure type should receive a NSRange C structure" do
@o.methodAcceptingNSRange(0..41).should == 0
@o.methodAcceptingNSRange(0..41).should == 1
@o.methodAcceptingNSRange(1..42).should == 0
@o.methodAcceptingNSRange(0..42).should == 1
@o.methodAcceptingNSRange(0...42).should == 0
@o.methodAcceptingNSRange(0..42).should == 0
@o.methodAcceptingNSRange(0...42).should == 1
@o.methodAcceptingNSRange(1...42).should == 0
@o.methodAcceptingNSRange(0...43).should == 1
@o.methodAcceptingNSRange(0...43).should == 0

lambda { @o.methodAcceptingNSRange(-1..1) }.should raise_error(ArgumentError)
lambda { @o.methodAcceptingNSRange(1..-1) }.should raise_error(ArgumentError)
Expand Down

0 comments on commit c6ae8ca

Please sign in to comment.