mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/spec@875a09e
This commit is contained in:
parent
a06301b103
commit
5c276e1cc9
1247 changed files with 5316 additions and 5028 deletions
|
|
@ -8,13 +8,13 @@ describe "SortedSet#add" do
|
|||
it "takes only values which responds <=>" do
|
||||
obj = mock('no_comparison_operator')
|
||||
obj.stub!(:respond_to?).with(:<=>).and_return(false)
|
||||
lambda { SortedSet["hello"].add(obj) }.should raise_error(ArgumentError)
|
||||
-> { SortedSet["hello"].add(obj) }.should raise_error(ArgumentError)
|
||||
end
|
||||
|
||||
it "raises on incompatible <=> comparison" do
|
||||
# Use #to_a here as elements are sorted only when needed.
|
||||
# Therefore the <=> incompatibility is only noticed on sorting.
|
||||
lambda { SortedSet['1', '2'].add(3).to_a }.should raise_error(ArgumentError)
|
||||
-> { SortedSet['1', '2'].add(3).to_a }.should raise_error(ArgumentError)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ describe "SortedSet#^" do
|
|||
end
|
||||
|
||||
it "raises an ArgumentError when passed a non-Enumerable" do
|
||||
lambda { @set ^ 3 }.should raise_error(ArgumentError)
|
||||
lambda { @set ^ Object.new }.should raise_error(ArgumentError)
|
||||
-> { @set ^ 3 }.should raise_error(ArgumentError)
|
||||
-> { @set ^ Object.new }.should raise_error(ArgumentError)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -25,6 +25,6 @@ describe "SortedSet#initialize" do
|
|||
it "raises on incompatible <=> comparison" do
|
||||
# Use #to_a here as elements are sorted only when needed.
|
||||
# Therefore the <=> incompatibility is only noticed on sorting.
|
||||
lambda { SortedSet.new(['00', nil]).to_a }.should raise_error(ArgumentError)
|
||||
-> { SortedSet.new(['00', nil]).to_a }.should raise_error(ArgumentError)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ describe "SortedSet#merge" do
|
|||
end
|
||||
|
||||
it "raises an ArgumentError when passed a non-Enumerable" do
|
||||
lambda { SortedSet[1, 2].merge(1) }.should raise_error(ArgumentError)
|
||||
lambda { SortedSet[1, 2].merge(Object.new) }.should raise_error(ArgumentError)
|
||||
-> { SortedSet[1, 2].merge(1) }.should raise_error(ArgumentError)
|
||||
-> { SortedSet[1, 2].merge(Object.new) }.should raise_error(ArgumentError)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -25,9 +25,9 @@ describe "SortedSet#proper_subset?" do
|
|||
end
|
||||
|
||||
it "raises an ArgumentError when passed a non-SortedSet" do
|
||||
lambda { SortedSet[].proper_subset?([]) }.should raise_error(ArgumentError)
|
||||
lambda { SortedSet[].proper_subset?(1) }.should raise_error(ArgumentError)
|
||||
lambda { SortedSet[].proper_subset?("test") }.should raise_error(ArgumentError)
|
||||
lambda { SortedSet[].proper_subset?(Object.new) }.should raise_error(ArgumentError)
|
||||
-> { SortedSet[].proper_subset?([]) }.should raise_error(ArgumentError)
|
||||
-> { SortedSet[].proper_subset?(1) }.should raise_error(ArgumentError)
|
||||
-> { SortedSet[].proper_subset?("test") }.should raise_error(ArgumentError)
|
||||
-> { SortedSet[].proper_subset?(Object.new) }.should raise_error(ArgumentError)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -25,9 +25,9 @@ describe "SortedSet#proper_superset?" do
|
|||
end
|
||||
|
||||
it "raises an ArgumentError when passed a non-SortedSet" do
|
||||
lambda { SortedSet[].proper_superset?([]) }.should raise_error(ArgumentError)
|
||||
lambda { SortedSet[].proper_superset?(1) }.should raise_error(ArgumentError)
|
||||
lambda { SortedSet[].proper_superset?("test") }.should raise_error(ArgumentError)
|
||||
lambda { SortedSet[].proper_superset?(Object.new) }.should raise_error(ArgumentError)
|
||||
-> { SortedSet[].proper_superset?([]) }.should raise_error(ArgumentError)
|
||||
-> { SortedSet[].proper_superset?(1) }.should raise_error(ArgumentError)
|
||||
-> { SortedSet[].proper_superset?("test") }.should raise_error(ArgumentError)
|
||||
-> { SortedSet[].proper_superset?(Object.new) }.should raise_error(ArgumentError)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ describe :sorted_set_difference, shared: true do
|
|||
end
|
||||
|
||||
it "raises an ArgumentError when passed a non-Enumerable" do
|
||||
lambda { @set.send(@method, 1) }.should raise_error(ArgumentError)
|
||||
lambda { @set.send(@method, Object.new) }.should raise_error(ArgumentError)
|
||||
-> { @set.send(@method, 1) }.should raise_error(ArgumentError)
|
||||
-> { @set.send(@method, Object.new) }.should raise_error(ArgumentError)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ describe :sorted_set_intersection, shared: true do
|
|||
end
|
||||
|
||||
it "raises an ArgumentError when passed a non-Enumerable" do
|
||||
lambda { @set.send(@method, 1) }.should raise_error(ArgumentError)
|
||||
lambda { @set.send(@method, Object.new) }.should raise_error(ArgumentError)
|
||||
-> { @set.send(@method, 1) }.should raise_error(ArgumentError)
|
||||
-> { @set.send(@method, Object.new) }.should raise_error(ArgumentError)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ describe :sorted_set_union, shared: true do
|
|||
end
|
||||
|
||||
it "raises an ArgumentError when passed a non-Enumerable" do
|
||||
lambda { @set.send(@method, 1) }.should raise_error(ArgumentError)
|
||||
lambda { @set.send(@method, Object.new) }.should raise_error(ArgumentError)
|
||||
-> { @set.send(@method, 1) }.should raise_error(ArgumentError)
|
||||
-> { @set.send(@method, Object.new) }.should raise_error(ArgumentError)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -25,9 +25,9 @@ describe "SortedSet#subset?" do
|
|||
end
|
||||
|
||||
it "raises an ArgumentError when passed a non-SortedSet" do
|
||||
lambda { SortedSet[].subset?([]) }.should raise_error(ArgumentError)
|
||||
lambda { SortedSet[].subset?(1) }.should raise_error(ArgumentError)
|
||||
lambda { SortedSet[].subset?("test") }.should raise_error(ArgumentError)
|
||||
lambda { SortedSet[].subset?(Object.new) }.should raise_error(ArgumentError)
|
||||
-> { SortedSet[].subset?([]) }.should raise_error(ArgumentError)
|
||||
-> { SortedSet[].subset?(1) }.should raise_error(ArgumentError)
|
||||
-> { SortedSet[].subset?("test") }.should raise_error(ArgumentError)
|
||||
-> { SortedSet[].subset?(Object.new) }.should raise_error(ArgumentError)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -25,9 +25,9 @@ describe "SortedSet#superset?" do
|
|||
end
|
||||
|
||||
it "raises an ArgumentError when passed a non-SortedSet" do
|
||||
lambda { SortedSet[].superset?([]) }.should raise_error(ArgumentError)
|
||||
lambda { SortedSet[].superset?(1) }.should raise_error(ArgumentError)
|
||||
lambda { SortedSet[].superset?("test") }.should raise_error(ArgumentError)
|
||||
lambda { SortedSet[].superset?(Object.new) }.should raise_error(ArgumentError)
|
||||
-> { SortedSet[].superset?([]) }.should raise_error(ArgumentError)
|
||||
-> { SortedSet[].superset?(1) }.should raise_error(ArgumentError)
|
||||
-> { SortedSet[].superset?("test") }.should raise_error(ArgumentError)
|
||||
-> { SortedSet[].superset?(Object.new) }.should raise_error(ArgumentError)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue