Skip to content

Commit af3abd1

Browse files
committed
Fix tests for RSpec 3
1 parent 3f247df commit af3abd1

File tree

8 files changed

+37
-37
lines changed

8 files changed

+37
-37
lines changed

spec/heap_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@
4747
end
4848

4949
it "should have a next value" do
50-
@heap.next.should be_true
51-
@heap.next_key.should be_true
50+
@heap.next.should be_truthy
51+
@heap.next_key.should be_truthy
5252
end
5353

5454
it "should delete random keys" do

spec/priority_queue_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
@q.next.should be_nil
1717
@q.pop.should be_nil
1818
@q.delete(1).should be_nil
19-
@q.has_priority?(1).should be_false
19+
@q.has_priority?(1).should be false
2020
end
2121

2222
it "should give the correct size when adding items" do
@@ -56,8 +56,8 @@
5656
end
5757

5858
it "should has_priority? priorities it has" do
59-
@q.has_priority?(50).should be_true
60-
@q.has_priority?(10).should be_false
59+
@q.has_priority?(50).should be true
60+
@q.has_priority?(10).should be false
6161
end
6262

6363
it "should return nil after popping everything" do

spec/queue_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
end
2222

2323
it "should return empty?" do
24-
@queue.empty?.should be_true
24+
@queue.empty?.should be true
2525
end
2626
end
2727

@@ -41,7 +41,7 @@
4141
end
4242

4343
it "should not return empty?" do
44-
@queue.empty?.should be_false
44+
@queue.empty?.should be false
4545
end
4646

4747
it "should iterate in FIFO order" do

spec/rb_tree_map_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
end
99

1010
it "should be empty?" do
11-
@tree.empty?.should be_true
11+
@tree.empty?.should be true
1212
end
1313

1414
it "should return 0 for height" do
@@ -51,11 +51,11 @@
5151
end
5252

5353
it "should not #has_key? keys it doesn't have" do
54-
@tree.has_key?(100000).should be_false
54+
@tree.has_key?(100000).should be false
5555
end
5656

5757
it "should #has_key? keys it does have" do
58-
@tree.has_key?(@random_array[0]).should be_true
58+
@tree.has_key?(@random_array[0]).should be true
5959
end
6060

6161
it "should remove all keys" do

spec/splay_tree_map_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,18 @@
4949
end
5050

5151
it "should not #has_key? keys it doesn't have" do
52-
@tree.has_key?(10000).should be_false
52+
@tree.has_key?(10000).should be false
5353
end
5454

5555
it "should #has_key? keys it does have" do
56-
@tree.has_key?(@random_array[0]).should be_true
56+
@tree.has_key?(@random_array[0]).should be true
5757
end
5858

5959
it "should remove any key" do
6060
random_key = @random_array[rand(@num_items)]
61-
@tree.has_key?(random_key).should be_true
61+
@tree.has_key?(random_key).should be true
6262
@tree.delete(random_key).should eql(random_key)
63-
@tree.has_key?(random_key).should be_false
63+
@tree.has_key?(random_key).should be false
6464
end
6565

6666
it "should let you iterate with #each" do

spec/stack_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
end
2121

2222
it "should return empty?" do
23-
@stack.empty?.should be_true
23+
@stack.empty?.should be true
2424
end
2525
end
2626

@@ -40,7 +40,7 @@
4040
end
4141

4242
it "should not return empty?" do
43-
@stack.empty?.should be_false
43+
@stack.empty?.should be false
4444
end
4545

4646

spec/suffix_array_spec.rb

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,28 +13,28 @@
1313
end
1414

1515
it "should has_substring? each possible substring" do
16-
@s_array.has_substring?("a").should be_true
17-
@s_array.has_substring?("abra").should be_true
18-
@s_array.has_substring?("abracadabra").should be_true
19-
@s_array.has_substring?("acadabra").should be_true
20-
@s_array.has_substring?("adabra").should be_true
21-
@s_array.has_substring?("bra").should be_true
22-
@s_array.has_substring?("bracadabra").should be_true
23-
@s_array.has_substring?("cadabra").should be_true
24-
@s_array.has_substring?("dabra").should be_true
25-
@s_array.has_substring?("ra").should be_true
26-
@s_array.has_substring?("racadabra").should be_true
16+
@s_array.has_substring?("a").should be true
17+
@s_array.has_substring?("abra").should be true
18+
@s_array.has_substring?("abracadabra").should be true
19+
@s_array.has_substring?("acadabra").should be true
20+
@s_array.has_substring?("adabra").should be true
21+
@s_array.has_substring?("bra").should be true
22+
@s_array.has_substring?("bracadabra").should be true
23+
@s_array.has_substring?("cadabra").should be true
24+
@s_array.has_substring?("dabra").should be true
25+
@s_array.has_substring?("ra").should be true
26+
@s_array.has_substring?("racadabra").should be true
2727
end
2828

2929
it "should not has_substring? substrings it does not have" do
30-
@s_array.has_substring?("nope").should be_false
31-
@s_array.has_substring?(nil).should be_false
30+
@s_array.has_substring?("nope").should be false
31+
@s_array.has_substring?(nil).should be false
3232
end
3333

3434
it "should work with numbers (calls to_s)" do
3535
number = Containers::SuffixArray.new(123456789)
36-
number[1].should be_true
37-
number.has_substring?(12).should be_true
38-
number.has_substring?(13).should be_false
36+
number[1].should be true
37+
number.has_substring?(12).should be true
38+
number.has_substring?(13).should be false
3939
end
4040
end

spec/trie_spec.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
it "should not get or has_key?" do
1010
@trie.get("anything").should be_nil
11-
@trie.has_key?("anything").should be_false
11+
@trie.has_key?("anything").should be false
1212
end
1313

1414
it "should not have longest_prefix or match wildcards" do
@@ -27,13 +27,13 @@
2727
end
2828

2929
it "should has_key? keys it has" do
30-
@trie.has_key?("Hello").should be_true
31-
@trie.has_key?("Hello, brother").should be_true
32-
@trie.has_key?("Hello, bob").should be_true
30+
@trie.has_key?("Hello").should be true
31+
@trie.has_key?("Hello, brother").should be true
32+
@trie.has_key?("Hello, bob").should be true
3333
end
3434

3535
it "should not has_key? keys it doesn't have" do
36-
@trie.has_key?("Nope").should be_false
36+
@trie.has_key?("Nope").should be false
3737
end
3838

3939
it "should get values" do

0 commit comments

Comments
 (0)