Skip to content
This repository
Browse code

Remove should from spec description

  • Loading branch information...
commit fe344f4a50b4755539340e6386a48e50e02bfbb1 1 parent ea7e18f
Jesse Cooke authored January 14, 2012 brixen committed January 14, 2012
14  core/binding/location_spec.rb
@@ -2,44 +2,44 @@
2 2
 require File.expand_path('../fixtures/classes', __FILE__)
3 3
 
4 4
 describe "Binding#eval" do
5  
-  it "should inherit __LINE__ from the enclosing scope" do
  5
+  it "inherits __LINE__ from the enclosing scope" do
6 6
     obj = BindingSpecs::Demo.new(1)
7 7
     bind = obj.get_binding
8 8
     bind.eval("__LINE__").should == obj.get_line_of_binding
9 9
   end
10 10
 
11  
-  it "should presere __LINE__ across multiple calls to eval" do
  11
+  it "preserves __LINE__ across multiple calls to eval" do
12 12
     obj = BindingSpecs::Demo.new(1)
13 13
     bind = obj.get_binding
14 14
     bind.eval("__LINE__").should == obj.get_line_of_binding
15 15
     bind.eval("__LINE__").should == obj.get_line_of_binding
16 16
   end
17 17
 
18  
-  it "should increment __LINE__ on each line of a multiline eval" do
  18
+  it "increments __LINE__ on each line of a multiline eval" do
19 19
     obj = BindingSpecs::Demo.new(1)
20 20
     bind = obj.get_binding
21 21
     bind.eval("#foo\n__LINE__").should == obj.get_line_of_binding + 1
22 22
   end
23 23
 
24  
-  it "should start with a __LINE__ of 1 if a filename is passed" do
  24
+  it "starts with a __LINE__ of 1 if a filename is passed" do
25 25
     bind = BindingSpecs::Demo.new(1).get_binding
26 26
     bind.eval("__LINE__", "(test)").should == 1
27 27
     bind.eval("#foo\n__LINE__", "(test)").should == 2
28 28
   end
29 29
 
30  
-  it "should start witha a __LINE__ from the third argument if passed" do
  30
+  it "starts with a __LINE__ from the third argument if passed" do
31 31
     bind = BindingSpecs::Demo.new(1).get_binding
32 32
     bind.eval("__LINE__", "(test)", 88).should == 88
33 33
     bind.eval("#foo\n__LINE__", "(test)", 88).should == 89
34 34
   end
35 35
 
36  
-  it "should inherit __FILE__ from the enclosing scope" do
  36
+  it "inherits __FILE__ from the enclosing scope" do
37 37
     obj = BindingSpecs::Demo.new(1)
38 38
     bind = obj.get_binding
39 39
     bind.eval("__FILE__").should == obj.get_file_of_binding
40 40
   end
41 41
 
42  
-  it "should use the __FILE__ that is passed in" do
  42
+  it "uses the __FILE__ that is passed in" do
43 43
     bind = BindingSpecs::Demo.new(1).get_binding
44 44
     bind.eval("__FILE__", "(test)").should == "(test)"
45 45
   end
4  core/enumerator/each_with_index_spec.rb
@@ -25,8 +25,8 @@
25 25
 end
26 26
 
27 27
 describe "Enumerator#each_with_index" do
28  
-  it "should return the correct value if chained with itself" do
  28
+  it "returns the correct value if chained with itself" do
29 29
     [:a].each_with_index.each_with_index.to_a.should == [[[:a,0],0]]
30 30
     [:a].each.with_index.with_index.to_a.should == [[[:a,0],0]]
31 31
   end
32  
-end
  32
+end
2  core/enumerator/inject_spec.rb
@@ -3,7 +3,7 @@
3 3
 describe "Enumerator#inject" do
4 4
   it_behaves_like(:enum_each, :each)
5 5
   
6  
-  it "should work when chained against each_with_index" do
  6
+  it "works when chained against each_with_index" do
7 7
     passed_values = []
8 8
     [:a].each_with_index.inject(0) do |accumulator,value|
9 9
       passed_values << value
2  core/exception/redefining_backtrace.rb
... ...
@@ -1,7 +1,7 @@
1 1
 require File.expand_path('../../../spec_helper', __FILE__)
2 2
 
3 3
 describe "Redefining #bactrace on an instance of Exception" do
4  
-  it "should not affect the behaviour of Exception#message" do
  4
+  it "does not affect the behaviour of Exception#message" do
5 5
     e = Exception.new
6 6
     e.message.should == 'Exception'
7 7
     
10  language/if_spec.rb
@@ -247,25 +247,25 @@
247 247
       ScratchPad.recorded.should == [4, 5, 7, 8]
248 248
     end
249 249
 
250  
-    it "should evaluate the first conditions lazyly with inclusive-end range" do
  250
+    it "evaluates the first conditions lazily with inclusive-end range" do
251 251
       collector = proc { |i| ScratchPad << i }
252 252
       10.times { |i| i if collector[i]...false }
253 253
       ScratchPad.recorded.should == [0]
254 254
     end
255 255
 
256  
-    it "should evaluate the first conditions lazyly with exclusive-end range" do
  256
+    it "evaluates the first conditions lazily with exclusive-end range" do
257 257
       collector = proc { |i| ScratchPad << i }
258 258
       10.times { |i| i if collector[i]..false }
259 259
       ScratchPad.recorded.should == [0]
260 260
     end
261 261
 
262  
-    it "should evaluate the second conditions lazyly with inclusive-end range" do
  262
+    it "evaluates the second conditions lazily with inclusive-end range" do
263 263
       collector = proc { |i| ScratchPad << i }
264 264
       10.times { |i| i if (i == 4)...collector[i] }
265 265
       ScratchPad.recorded.should == [5]
266 266
     end
267 267
 
268  
-    it "should evaluate the second conditions lazyly with exclusive-end range" do
  268
+    it "evaluates the second conditions lazily with exclusive-end range" do
269 269
       collector = proc { |i| ScratchPad << i }
270 270
       10.times { |i| i if (i == 4)..collector[i] }
271 271
       ScratchPad.recorded.should == [4]
@@ -281,7 +281,7 @@
281 281
       ScratchPad.recorded.should == [4, 1, 7]
282 282
     end
283 283
 
284  
-    it 'keeps flip-flops from interfering' do
  284
+    it "keeps flip-flops from interfering" do
285 285
       a = proc { |i| ScratchPad << i if (i == 4)..(i == 7) }
286 286
       b = proc { |i| ScratchPad << i if (i == 4)..(i == 7) }
287 287
       6.times(&a)
26  library/date/accessor_spec.rb
@@ -2,71 +2,71 @@
2 2
 require File.expand_path('../../../spec_helper', __FILE__)
3 3
 
4 4
 describe "Date#ajd" do
5  
-  it "should be able to determine the Astronomical Julian day for a date" do
  5
+  it "determines the Astronomical Julian day" do
6 6
     Date.civil(2007, 1, 17).ajd.should == 4908235.to_r / 2
7 7
   end
8 8
 end
9 9
 
10 10
 describe "Date#amjd" do
11  
-  it "should be able to determine the Astronomical Modified Julian day for a date" do
  11
+  it "determines the Astronomical Modified Julian day" do
12 12
     Date.civil(2007, 1, 17).amjd.should == 54117
13 13
   end
14 14
 end
15 15
 
16 16
 describe "Date#day_fraction" do
17  
-  it "should be able to determine the day fraction for a date" do
  17
+  it "determines the day fraction" do
18 18
     Date.civil(2007, 1, 17).day_fraction.should == 0
19 19
   end
20 20
 end
21 21
 
22 22
 describe "Date#mjd" do
23  
-  it "should be able to determine the Modified Julian day for a date" do
  23
+  it "determines the Modified Julian day" do
24 24
     Date.civil(2007, 1, 17).mjd.should == 54117
25 25
   end
26 26
 end
27 27
 
28 28
 describe "Date#ld" do
29  
-  it "should be able to determine the Modified Julian day for a date" do
  29
+  it "determines the Modified Julian day" do
30 30
     Date.civil(2007, 1, 17).ld.should == 154958
31 31
   end
32 32
 end
33 33
 
34 34
 describe "Date#year" do
35  
-  it "should be able to determine the year for a date" do
  35
+  it "determines the year" do
36 36
     Date.civil(2007, 1, 17).year.should == 2007
37 37
   end
38 38
 end
39 39
 
40 40
 describe "Date#yday" do
41  
-  it "should be able to determine the year for a date" do
  41
+  it "determines the year" do
42 42
     Date.civil(2007,  1, 17).yday.should == 17
43 43
     Date.civil(2008, 10, 28).yday.should == 302
44 44
   end
45 45
 end
46 46
 
47 47
 describe "Date#mon" do
48  
-  it "should be able to determine the month for a date" do
  48
+  it "determines the month" do
49 49
     Date.civil(2007,  1, 17).mon.should == 1
50 50
     Date.civil(2008, 10, 28).mon.should == 10
51 51
   end
52 52
 end
53 53
 
54 54
 describe "Date#mday" do
55  
-  it "should be able to determine the day of the month for a date" do
  55
+  it "determines the day of the month" do
56 56
     Date.civil(2007,  1, 17).mday.should == 17
57 57
     Date.civil(2008, 10, 28).mday.should == 28
58 58
   end
59 59
 end
60 60
 
61 61
 describe "Date#wday" do
62  
-  it "should be able to determine the week day for a date" do
  62
+  it "determines the week day" do
63 63
     Date.civil(2007,  1, 17).wday.should == 3
64 64
     Date.civil(2008, 10, 26).wday.should == 0
65 65
   end
66 66
 end
67 67
 
68 68
 describe "Date#cwyear" do
69  
-  it "should be able to determine the commercial year for a date" do
  69
+  it "determines the commercial year" do
70 70
     Date.civil(2007,  1, 17).cwyear.should == 2007
71 71
     Date.civil(2008, 10, 28).cwyear.should == 2008
72 72
     Date.civil(2007, 12, 31).cwyear.should == 2008
@@ -75,7 +75,7 @@
75 75
 end
76 76
 
77 77
 describe "Date#cweek" do
78  
-  it "should be able to determine the commercial week for a date" do
  78
+  it "determines the commercial week" do
79 79
     Date.civil(2007,  1, 17).cweek.should == 3
80 80
     Date.civil(2008, 10, 28).cweek.should == 44
81 81
     Date.civil(2007, 12, 31).cweek.should == 1
@@ -84,7 +84,7 @@
84 84
 end
85 85
 
86 86
 describe "Date#cwday" do
87  
-  it "should be able to determine the commercial week day for a date" do
  87
+  it "determines the commercial week day" do
88 88
     Date.civil(2007,  1, 17).cwday.should == 3
89 89
     Date.civil(2008, 10, 26).cwday.should == 7
90 90
   end
6  library/date/minus_month_spec.rb
@@ -3,17 +3,17 @@
3 3
 
4 4
 describe "Date#<<" do
5 5
 
6  
-  it "should substract a number of months from a date" do
  6
+  it "substracts a number of months from a date" do
7 7
     d = Date.civil(2007,2,27) << 10
8 8
     d.should == Date.civil(2006, 4, 27)
9 9
   end
10 10
 
11  
-  it "should result in the last day of a month if the day doesn't exist" do
  11
+  it "returns the last day of a month if the day doesn't exist" do
12 12
     d = Date.civil(2008,3,31) << 1
13 13
     d.should == Date.civil(2008, 2, 29)
14 14
   end
15 15
 
16  
-  it "should raise an error on non numeric parameters" do
  16
+  it "raises an error on non numeric parameters" do
17 17
     lambda { Date.civil(2007,2,27) << :hello }.should raise_error(NoMethodError)
18 18
     lambda { Date.civil(2007,2,27) << "hello" }.should raise_error(NoMethodError)
19 19
     lambda { Date.civil(2007,2,27) << Date.new }.should raise_error(NoMethodError)
6  library/date/relationship_spec.rb
@@ -3,16 +3,16 @@
3 3
 
4 4
 describe "Date#===" do
5 5
 
6  
-  it "should be able to compare two same dates" do
  6
+  it "returns 0 when comparing two equal dates" do
7 7
     (Date.civil(2000, 04, 06) <=> Date.civil(2000, 04, 06)).should == 0
8 8
   end
9 9
 
10  
-  it "should be able to compute the difference between two dates" do
  10
+  it "computes the difference between two dates" do
11 11
     (Date.civil(2000, 04, 05) <=> Date.civil(2000, 04, 06)).should == -1
12 12
     (Date.civil(2001, 04, 05) <=> Date.civil(2000, 04, 06)).should == 1
13 13
   end
14 14
 
15  
-  it "should be able to compare to another numeric" do
  15
+  it "compares to another numeric" do
16 16
     (Date.civil(2000, 04, 05) <=> Date.civil(2000, 04, 06).jd).should == -1
17 17
     (Date.civil(2001, 04, 05) <=> Date.civil(2000, 04, 06).jd).should == 1
18 18
   end
4  library/date/shared/ordinal.rb
@@ -9,7 +9,7 @@
9 9
 describe :date_ordinal, :shared => true do
10 10
 
11 11
   ruby_version_is "" ... "1.9" do
12  
-    it "should be able to construct a Date object from an ordinal date" do
  12
+    it "constructs a Date object from an ordinal date" do
13 13
       # October 1582 (the Gregorian calendar, Ordinal Date in 1.8)
14 14
       #   S   M  Tu   W  Th   F   S
15 15
       #     274 275 276 277 288 289
@@ -26,7 +26,7 @@
26 26
   end
27 27
 
28 28
   ruby_version_is "1.9" do
29  
-    it "should be able to construct a Date object from an ordinal date" do
  29
+    it "constructs a Date object from an ordinal date" do
30 30
       # October 1582 (the Gregorian calendar, Ordinal Date in 1.9)
31 31
       #   S   M  Tu   W  Th   F   S
32 32
       #     274 275 276 277 278 279
8  library/date/shared/valid_ordinal.rb
... ...
@@ -1,6 +1,6 @@
1 1
 describe :date_valid_ordinal?, :shared => true do
2 2
   ruby_version_is "" ... "1.9" do
3  
-    it "should be able to determine if the date is a valid ordinal date" do
  3
+    it "determines if the date is a valid ordinal date" do
4 4
       # October 1582 (the Gregorian calendar, Ordinal Date in 1.8)
5 5
       #   S   M  Tu   W  Th   F   S
6 6
       #     274 275 276 277 278 279
@@ -15,7 +15,7 @@
15 15
       Date.send(@method, 1582, 287, Date::ENGLAND).should == Date.civil(1582, 10, 14, Date::ENGLAND).jd
16 16
     end
17 17
 
18  
-    it "should be able to handle negative day numbers" do
  18
+    it "handles negative day numbers" do
19 19
       # October 1582 (the Gregorian calendar, Ordinal Date in 1.8)
20 20
       #   S   M  Tu   W  Th   F   S
21 21
       #     -92 -91 -90 -89 -78 -77
@@ -31,7 +31,7 @@
31 31
   end
32 32
 
33 33
   ruby_version_is "1.9" do
34  
-    it "should be able to determine if the date is a valid ordinal date" do
  34
+    it "determines if the date is a valid ordinal date" do
35 35
       # October 1582 (the Gregorian calendar, Ordinal Date in 1.9)
36 36
       #   S   M  Tu   W  Th   F   S
37 37
       #     274 275 276 277 278 279
@@ -44,7 +44,7 @@
44 44
       Date.send(@method, 1582, 288).should == true
45 45
     end
46 46
 
47  
-    it "should be able to handle negative day numbers" do
  47
+    it "handles negative day numbers" do
48 48
       # October 1582 (the Gregorian calendar, Ordinal Date in 1.9)
49 49
       #   S   M  Tu   W  Th   F   S
50 50
       #     -82 -81 -80 -79 -78 -77
4  library/date/step_spec.rb
@@ -3,7 +3,7 @@
3 3
 
4 4
 describe "Date#step" do
5 5
 
6  
-  it "should be able to step forward in time" do
  6
+  it "steps forward in time" do
7 7
     ds    = Date.civil(2008, 10, 11)
8 8
     de    = Date.civil(2008,  9, 29)
9 9
     count = 0
@@ -28,7 +28,7 @@
28 28
 
29 29
   end
30 30
 
31  
-  it "should be able to step backward in time" do
  31
+  it "steps backward in time" do
32 32
     ds    = Date.civil(2000, 4, 14)
33 33
     de    = Date.civil(2000, 3, 29)
34 34
     count = 0
8  library/digest/md5/equal_spec.rb
@@ -3,17 +3,17 @@
3 3
 
4 4
 describe "Digest::MD5#==" do
5 5
 
6  
-  it 'should be equal to itself' do
  6
+  it "equals itself" do
7 7
     cur_digest = Digest::MD5.new
8 8
     cur_digest.should == cur_digest
9 9
   end
10 10
 
11  
-  it 'should be equal to string representing its hexdigest' do
  11
+  it "equals the string representing its hexdigest" do
12 12
     cur_digest = Digest::MD5.new
13 13
     cur_digest.should == MD5Constants::BlankHexdigest
14 14
   end
15 15
 
16  
-  it 'should be equal to appropriate object that responds to to_str' do
  16
+  it "equals the appropriate object that responds to to_str" do
17 17
     # blank digest
18 18
     cur_digest = Digest::MD5.new
19 19
     obj = mock(MD5Constants::BlankHexdigest)
@@ -28,7 +28,7 @@
28 28
     cur_digest.should == obj
29 29
   end
30 30
 
31  
-  it 'should be equal for same digest different object' do
  31
+  it "equals the same digest for a different object" do
32 32
     cur_digest = Digest::MD5.new
33 33
     cur_digest2 = Digest::MD5.new
34 34
     cur_digest.should == cur_digest2
8  library/digest/sha256/equal_spec.rb
@@ -3,17 +3,17 @@
3 3
 
4 4
 describe "Digest::SHA256#==" do
5 5
 
6  
-  it 'should be equal to itself' do
  6
+  it "equals itself" do
7 7
     cur_digest = Digest::SHA256.new
8 8
     cur_digest.should == cur_digest
9 9
   end
10 10
 
11  
-  it 'should be equal to string representing its hexdigest' do
  11
+  it "equals the string representing its hexdigest" do
12 12
     cur_digest = Digest::SHA256.new
13 13
     cur_digest.should == SHA256Constants::BlankHexdigest
14 14
   end
15 15
 
16  
-  it 'should be equal to appropriate object that responds to to_str' do
  16
+  it "equals the appropriate object that responds to to_str" do
17 17
     # blank digest
18 18
     cur_digest = Digest::SHA256.new
19 19
     (obj = mock(SHA256Constants::BlankHexdigest)).should_receive(:to_str).and_return(SHA256Constants::BlankHexdigest)
@@ -27,7 +27,7 @@
27 27
     cur_digest.should == obj
28 28
   end
29 29
 
30  
-  it 'should be equal for same digest different object' do
  30
+  it "equals the same digest for a different object" do
31 31
     cur_digest = Digest::SHA256.new
32 32
     cur_digest2 = Digest::SHA256.new
33 33
     cur_digest.should == cur_digest2
2  library/digest/sha256/reset_spec.rb
@@ -3,7 +3,7 @@
3 3
 
4 4
 describe "Digest::SHA256#reset" do
5 5
 
6  
-  it 'can returns digest state to initial conditions' do
  6
+  it "returns digest state to initial conditions" do
7 7
     cur_digest = Digest::SHA256.new
8 8
     cur_digest.update SHA256Constants::Contents
9 9
     cur_digest.digest().should_not == SHA256Constants::BlankDigest
8  library/digest/sha384/equal_spec.rb
@@ -3,17 +3,17 @@
3 3
 
4 4
 describe "Digest::SHA384#==" do
5 5
 
6  
-  it 'should be equal to itself' do
  6
+  it "equals itself" do
7 7
     cur_digest = Digest::SHA384.new
8 8
     cur_digest.should == cur_digest
9 9
   end
10 10
 
11  
-  it 'should be equal to string representing its hexdigest' do
  11
+  it "equals the string representing its hexdigest" do
12 12
     cur_digest = Digest::SHA384.new
13 13
     cur_digest.should == SHA384Constants::BlankHexdigest
14 14
   end
15 15
 
16  
-  it 'should be equal to appropriate object that responds to to_str' do
  16
+  it "equals the appropriate object that responds to to_str" do
17 17
     # blank digest
18 18
     cur_digest = Digest::SHA384.new
19 19
     (obj = mock(SHA384Constants::BlankHexdigest)).should_receive(:to_str).and_return(SHA384Constants::BlankHexdigest)
@@ -27,7 +27,7 @@
27 27
     cur_digest.should == obj
28 28
   end
29 29
 
30  
-  it 'should be equal for same digest different object' do
  30
+  it "equals the same digest for a different object" do
31 31
     cur_digest = Digest::SHA384.new
32 32
     cur_digest2 = Digest::SHA384.new
33 33
     cur_digest.should == cur_digest2
8  library/digest/sha512/equal_spec.rb
@@ -3,17 +3,17 @@
3 3
 
4 4
 describe "Digest::SHA512#==" do
5 5
 
6  
-  it 'should be equal to itself' do
  6
+  it "equals itself" do
7 7
     cur_digest = Digest::SHA512.new
8 8
     cur_digest.should == cur_digest
9 9
   end
10 10
 
11  
-  it 'should be equal to string representing its hexdigest' do
  11
+  it "equals the string representing its hexdigest" do
12 12
     cur_digest = Digest::SHA512.new
13 13
     cur_digest.should == SHA512Constants::BlankHexdigest
14 14
   end
15 15
 
16  
-  it 'should be equal to appropriate object that responds to to_str' do
  16
+  it "equals the appropriate object that responds to to_str" do
17 17
     # blank digest
18 18
     cur_digest = Digest::SHA512.new
19 19
     (obj = mock(SHA512Constants::BlankHexdigest)).should_receive(:to_str).and_return(SHA512Constants::BlankHexdigest)
@@ -27,7 +27,7 @@
27 27
     cur_digest.should == obj
28 28
   end
29 29
 
30  
-  it 'should be equal for same digest different object' do
  30
+  it "equals the same digest for a different object" do
31 31
     cur_digest = Digest::SHA512.new
32 32
     cur_digest2 = Digest::SHA512.new
33 33
     cur_digest.should == cur_digest2
20  library/ipaddr/new_spec.rb
@@ -2,27 +2,27 @@
2 2
 require 'ipaddr'
3 3
 
4 4
 describe "IPAddr#new" do
5  
-  it 'it should initialize IPAddr' do
  5
+  it "initializes IPAddr" do
6 6
     lambda{ IPAddr.new("3FFE:505:ffff::/48") }.should_not raise_error
7 7
     lambda{ IPAddr.new("0:0:0:1::")          }.should_not raise_error
8 8
     lambda{ IPAddr.new("2001:200:300::/48")  }.should_not raise_error
9 9
   end
10 10
 
11  
-  it 'it should initialize IPAddr ipv6 address with short notation' do
  11
+  it "initializes IPAddr ipv6 address with short notation" do
12 12
     a = IPAddr.new
13 13
     a.to_s.should == "::"
14 14
     a.to_string.should == "0000:0000:0000:0000:0000:0000:0000:0000"
15 15
     a.family.should == Socket::AF_INET6
16 16
   end
17 17
 
18  
-  it 'it should initialize IPAddr ipv6 address with long notation' do
  18
+  it "initializes IPAddr ipv6 address with long notation" do
19 19
     a = IPAddr.new("0123:4567:89ab:cdef:0ABC:DEF0:1234:5678")
20 20
     a.to_s.should == "123:4567:89ab:cdef:abc:def0:1234:5678"
21 21
     a.to_string.should == "0123:4567:89ab:cdef:0abc:def0:1234:5678"
22 22
     a.family.should == Socket::AF_INET6
23 23
   end
24 24
 
25  
-  it 'it should initialize IPAddr ipv6 address with / subnet notation' do
  25
+  it "initializes IPAddr ipv6 address with / subnet notation" do
26 26
     a = IPAddr.new("3ffe:505:2::/48")
27 27
     a.to_s.should == "3ffe:505:2::"
28 28
     a.to_string.should == "3ffe:0505:0002:0000:0000:0000:0000:0000"
@@ -32,21 +32,21 @@
32 32
     a.inspect.should == "#<IPAddr: IPv6:3ffe:0505:0002:0000:0000:0000:0000:0000/ffff:ffff:ffff:0000:0000:0000:0000:0000>"
33 33
   end
34 34
 
35  
-  it 'it should initialize IPAddr ipv6 address with mask subnet notation' do
  35
+  it "initializes IPAddr ipv6 address with mask subnet notation" do
36 36
     a = IPAddr.new("3ffe:505:2::/ffff:ffff:ffff::")
37 37
     a.to_s.should == "3ffe:505:2::"
38 38
     a.to_string.should == "3ffe:0505:0002:0000:0000:0000:0000:0000"
39 39
     a.family.should == Socket::AF_INET6
40 40
   end
41 41
 
42  
-  it 'it should initialize IPAddr ipv4 address with all zeroes' do
  42
+  it "initializes IPAddr ipv4 address with all zeroes" do
43 43
     a = IPAddr.new("0.0.0.0")
44 44
     a.to_s.should == "0.0.0.0"
45 45
     a.to_string.should == "0.0.0.0"
46 46
     a.family.should == Socket::AF_INET
47 47
   end
48 48
 
49  
-  it 'it should initialize IPAddr ipv4 address' do
  49
+  it "initializes IPAddr ipv4 address" do
50 50
     a = IPAddr.new("192.168.1.2")
51 51
     a.to_s.should == "192.168.1.2"
52 52
     a.to_string.should == "192.168.1.2"
@@ -55,7 +55,7 @@
55 55
     a.ipv6?.should == false
56 56
   end
57 57
 
58  
-  it 'it should initialize IPAddr ipv4 address with / subnet notation' do
  58
+  it "initializes IPAddr ipv4 address with / subnet notation" do
59 59
     a = IPAddr.new("192.168.1.2/24")
60 60
     a.to_s.should == "192.168.1.0"
61 61
     a.to_string.should == "192.168.1.0"
@@ -63,14 +63,14 @@
63 63
     a.inspect.should == "#<IPAddr: IPv4:192.168.1.0/255.255.255.0>"
64 64
   end
65 65
 
66  
-  it 'it should initialize IPAddr ipv4 address wuth subnet mask' do
  66
+  it "initializes IPAddr ipv4 address with subnet mask" do
67 67
     a = IPAddr.new("192.168.1.2/255.255.255.0")
68 68
     a.to_s.should == "192.168.1.0"
69 69
     a.to_string.should == "192.168.1.0"
70 70
     a.family.should == Socket::AF_INET
71 71
   end
72 72
 
73  
-  it 'it should raise errors on incorrect IPAddr strings' do
  73
+  it "raises on incorrect IPAddr strings" do
74 74
     [
75 75
       ["fe80::1%fxp0"],
76 76
       ["::1/255.255.255.0"],
18  library/ipaddr/operator_spec.rb
... ...
@@ -1,7 +1,7 @@
1 1
 require File.expand_path('../../../spec_helper', __FILE__)
2 2
 require 'ipaddr'
3 3
 
4  
-describe 'IPAddr Operator' do
  4
+describe "IPAddr Operator" do
5 5
   IN6MASK32  = "ffff:ffff::"
6 6
   IN6MASK128 = "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff"
7 7
 
@@ -12,7 +12,7 @@
12 12
     @c = IPAddr.new(IN6MASK32)
13 13
   end
14 14
 
15  
-  it 'should be able to bitwise or' do
  15
+  it "bitwises or" do
16 16
     (@a | @b).to_s.should == "3ffe:505:2:1::"
17 17
     a = @a
18 18
     a |= @b
@@ -21,7 +21,7 @@
21 21
     (@a | 0x00000000000000010000000000000000).to_s.should == "3ffe:505:2:1::"
22 22
   end
23 23
 
24  
-  it 'should be able to bitwise and' do
  24
+  it "bitwises and" do
25 25
     (@a & @c).to_s.should == "3ffe:505::"
26 26
     a = @a
27 27
     a &= @c
@@ -30,7 +30,7 @@
30 30
     (@a & 0xffffffff000000000000000000000000).to_s.should == "3ffe:505::"
31 31
   end
32 32
 
33  
-  it 'should be able to bitshift right' do
  33
+  it "bitshifts right" do
34 34
     (@a >> 16).to_s.should == "0:3ffe:505:2::"
35 35
     a = @a
36 36
     a >>= 16
@@ -38,7 +38,7 @@
38 38
     @a.to_s.should == "3ffe:505:2::"
39 39
   end
40 40
 
41  
-  it 'should be able to bitshift left' do
  41
+  it "bitshifts left" do
42 42
     (@a << 16).to_s.should == "505:2::"
43 43
     a = @a
44 44
     a <<= 16
@@ -46,24 +46,24 @@
46 46
     @a.to_s.should == "3ffe:505:2::"
47 47
   end
48 48
 
49  
-  it 'should be able to invert' do
  49
+  it "inverts" do
50 50
     a = ~@in6_addr_any
51 51
     a.to_s.should == IN6MASK128
52 52
     @in6_addr_any.to_s.should == "::"
53 53
   end
54 54
 
55  
-  it 'should be able to test for equality' do
  55
+  it "tests for equality" do
56 56
     @a.should == IPAddr.new("3ffe:505:2::")
57 57
     @a.should_not == IPAddr.new("3ffe:505:3::")
58 58
   end
59 59
 
60  
-  it 'should be able to set a mask' do
  60
+  it "sets a mask" do
61 61
     a = @a.mask(32)
62 62
     a.to_s.should == "3ffe:505::"
63 63
     @a.to_s.should == "3ffe:505:2::"
64 64
   end
65 65
 
66  
-  it 'should be able to check whether an addres is included in a range' do
  66
+  it "checks whether an addres is included in a range" do
67 67
     @a.should include(IPAddr.new("3ffe:505:2::"))
68 68
     @a.should include(IPAddr.new("3ffe:505:2::1"))
69 69
     @a.should_not include(IPAddr.new("3ffe:505:3::"))
6  library/ipaddr/reverse_spec.rb
@@ -2,14 +2,14 @@
2 2
 require 'ipaddr'
3 3
 
4 4
 describe "IPAddr#reverse" do
5  
-  it 'should be able to generate the reverse DNS lookup entry' do
  5
+  it "generates the reverse DNS lookup entry" do
6 6
     IPAddr.new("3ffe:505:2::f").reverse.should == "f.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.0.5.0.5.0.e.f.f.3.ip6.arpa"
7 7
     IPAddr.new("192.168.2.1").reverse.should == "1.2.168.192.in-addr.arpa"
8 8
   end
9 9
 end
10 10
 
11 11
 describe "IPAddr#ip6_arpa" do
12  
-  it 'should be able to convert an IPv6 address into the reverse DNS lookup representation according to RFC3172' do
  12
+  it "converts an IPv6 address into the reverse DNS lookup representation according to RFC3172" do
13 13
     IPAddr.new("3ffe:505:2::f").ip6_arpa.should == "f.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.0.5.0.5.0.e.f.f.3.ip6.arpa"
14 14
     lambda{
15 15
       IPAddr.new("192.168.2.1").ip6_arpa
@@ -18,7 +18,7 @@
18 18
 end
19 19
 
20 20
 describe "IPAddr#ip6_int" do
21  
-  it 'should be able to convert an IPv6 address into the reverse DNS lookup representation according to RFC1886' do
  21
+  it "converts an IPv6 address into the reverse DNS lookup representation according to RFC1886" do
22 22
     IPAddr.new("3ffe:505:2::f").ip6_int.should == "f.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.0.5.0.5.0.e.f.f.3.ip6.int"
23 23
     lambda{
24 24
       IPAddr.new("192.168.2.1").ip6_int
16  optional/ffi/callback_spec.rb
@@ -220,19 +220,19 @@
220 220
   end
221 221
 
222 222
   describe "When the callback is considered optional by the underlying library" do
223  
-    it "should handle receiving 'nil' in place of the closure" do
  223
+    it "handles receiving 'nil' in place of the closure" do
224 224
       lambda { FFISpecs::LibTest.testOptionalCallbackCrV(nil, 13) }.should_not raise_error
225 225
     end
226 226
   end
227 227
 
228  
-  describe 'when inlined' do
229  
-    it 'could be anonymous' do
  228
+  describe "when inlined" do
  229
+    it "could be anonymous" do
230 230
       FFISpecs::LibTest.testCallbackVrS8 { 0 }.should == 0
231 231
     end
232 232
   end
233 233
 
234 234
   describe "as return value" do
235  
-    it "should not blow up when a callback is defined that returns a callback" do
  235
+    it "does not blow up when a callback is defined that returns a callback" do
236 236
       lambda {
237 237
         FFISpecs::LibTest.module_eval do
238 238
           callback :cb_return_type_1, [ :short ], :short
@@ -242,7 +242,7 @@
242 242
       }.should_not raise_error
243 243
     end
244 244
 
245  
-    it "should return a callback" do
  245
+    it "returns a callback" do
246 246
       lookup_proc_called = false
247 247
       return_proc_called = false
248 248
 
@@ -261,7 +261,7 @@
261 261
       return_proc_called.should be_true
262 262
     end
263 263
 
264  
-    it 'should not blow up when a callback takes a callback as argument' do
  264
+    it "does not blow up when a callback takes a callback as argument" do
265 265
       lambda {
266 266
         FFISpecs::LibTest.module_eval do
267 267
           callback :cb_argument, [ :int ], :int
@@ -271,7 +271,7 @@
271 271
       }.should_not raise_error
272 272
     end
273 273
 
274  
-    it 'should be able to use the callback argument' do
  274
+    it "uses callback argument" do
275 275
       # TODO: Moving this to fixtures/classes.rb breaks
276 276
       module FFISpecs::LibTest
277 277
         callback :cb_argument, [ :int ], :int
@@ -298,7 +298,7 @@ module FFISpecs::LibTest
298 298
       callback_with_callback_arg_called.should be_true
299 299
     end
300 300
 
301  
-    it 'function returns callable object' do
  301
+    it "function returns callable object" do
302 302
       f = FFISpecs::LibTest.testReturnsFunctionPointer
303 303
       f.call(3).should == 6
304 304
     end
6  optional/ffi/managed_struct_spec.rb
... ...
@@ -1,18 +1,18 @@
1 1
 require File.expand_path('../spec_helper', __FILE__)
2 2
 
3 3
 describe "Managed Struct" do
4  
-  it "should raise an error if release() is not defined" do
  4
+  it "raises an error if release() is not defined" do
5 5
     lambda {
6 6
       FFISpecs::NoRelease.new(FFISpecs::LibTest.ptr_from_address(0x12345678))
7 7
     }.should raise_error(NoMethodError)
8 8
   end
9 9
 
10  
-  it "should be the right class" do
  10
+  it "is the right class" do
11 11
     ptr = FFISpecs::WhatClassAmI.new(FFISpecs::LibTest.ptr_from_address(0x12345678))
12 12
     ptr.should be_kind_of(FFISpecs::WhatClassAmI)
13 13
   end
14 14
 
15  
-  it "should release memory properly" do
  15
+  it "releases memory properly" do
16 16
     loop_count = 30
17 17
     wiggle_room = 2
18 18
 
8  optional/ffi/pointer_spec.rb
@@ -70,17 +70,17 @@
70 70
     end
71 71
   end
72 72
 
73  
-  describe 'NULL' do
74  
-    it 'should be obtained using Pointer::NULL constant' do
  73
+  describe "NULL" do
  74
+    it "is obtained using Pointer::NULL constant" do
75 75
       null_ptr = FFI::Pointer::NULL
76 76
       null_ptr.null?.should be_true
77 77
     end
78 78
 
79  
-    it 'should be obtained passing address 0 to constructor' do
  79
+    it "is obtained passing address 0 to constructor" do
80 80
       FFI::Pointer.new(0).null?.should be_true
81 81
     end
82 82
 
83  
-    it 'should raise an error when attempting read/write operations on it' do
  83
+    it "raises an error when attempting read/write operations on it" do
84 84
       null_ptr = FFI::Pointer::NULL
85 85
       lambda { null_ptr.read_int }.should raise_error(FFI::NullPointerError)
86 86
       lambda { null_ptr.write_int(0xff1) }.should raise_error(FFI::NullPointerError)
2  optional/ffi/struct_callback_spec.rb
... ...
@@ -1,7 +1,7 @@
1 1
 require File.expand_path('../spec_helper', __FILE__)
2 2
 
3 3
 describe FFI::Struct, ' with inline callback functions' do
4  
-  it 'should be able to define inline callback field' do
  4
+  it "defines inline callback field" do
5 5
     lambda {
6 6
       Module.new do
7 7
         extend FFI::Library
4  optional/ffi/struct_initialize_spec.rb
... ...
@@ -1,7 +1,7 @@
1 1
 require File.expand_path('../spec_helper', __FILE__)
2 2
 
3 3
 describe FFI::Struct, ' with an initialize function' do
4  
-  it "should call the initialize function" do
  4
+  it "calls the initialize function" do
5 5
     struct_with_initialize = Class.new(FFI::Struct) do
6 6
       layout :string, :string
7 7
       attr_accessor :magic
@@ -16,7 +16,7 @@ def initialize
16 16
 end
17 17
 
18 18
 describe FFI::ManagedStruct, ' with an initialize function' do
19  
-  it "should call the initialize function" do
  19
+  it "calls the initialize function" do
20 20
     managed_struct_with_initialize = Class.new(FFI::ManagedStruct) do
21 21
       layout :string, :string
22 22
       attr_accessor :magic
30  optional/ffi/struct_spec.rb
@@ -346,7 +346,7 @@ def self.int_field_test(type, values)
346 346
     s.values.should include(1, 2, 3)
347 347
   end
348 348
 
349  
-  it 'should return an ordered field/offset pairs array' do
  349
+  it "returns an ordered field/offset pairs array" do
350 350
     klass = Class.new(FFI::Struct)
351 351
     klass.layout :a, :int, :b, :int, :c, :int
352 352
 
@@ -370,25 +370,25 @@ def self.int_field_test(type, values)
370 370
     @cs = FFISpecs::LibTest::ContainerStruct.new
371 371
   end
372 372
 
373  
-  it 'should align correctly nested struct field' do
  373
+  it "aligns correctly nested struct field" do
374 374
     @cs[:ns][:i] = 123
375 375
     FFISpecs::LibTest.struct_align_nested_struct(@cs.to_ptr).should == 123
376 376
   end
377 377
 
378  
-  it 'should correctly calculate Container size (in bytes)' do
  378
+  it "calculates Container size (in bytes)" do
379 379
     FFISpecs::LibTest::ContainerStruct.size.should == 8
380 380
   end
381 381
 
382  
-  it 'should return a Struct object when the field is accessed' do
  382
+  it "returns a Struct object when the field is accessed" do
383 383
     @cs[:ns].is_a?(FFI::Struct).should be_true
384 384
   end
385 385
 
386  
-  it 'should read a value from memory' do
  386
+  it "reads a value from memory" do
387 387
     @cs = FFISpecs::LibTest::ContainerStruct.new(FFISpecs::LibTest.struct_make_container_struct(123))
388 388
     @cs[:ns][:i].should == 123
389 389
   end
390 390
 
391  
-  it 'should write a value to memory' do
  391
+  it "writes a value to memory" do
392 392
     @cs = FFISpecs::LibTest::ContainerStruct.new(FFISpecs::LibTest.struct_make_container_struct(123))
393 393
     @cs[:ns][:i] = 456
394 394
     FFISpecs::LibTest.struct_align_nested_struct(@cs.to_ptr).should == 456
@@ -400,37 +400,37 @@ def self.int_field_test(type, values)
400 400
     @s = FFISpecs::LibTest::StructWithArray.new
401 401
   end
402 402
 
403  
-  it 'should correctly calculate StructWithArray size (in bytes)' do
  403
+  it "calculates StructWithArray size (in bytes)" do
404 404
     FFISpecs::LibTest::StructWithArray.size.should == 24
405 405
   end
406 406
 
407  
-  it 'should read values from memory' do
  407
+  it "reads values from memory" do
408 408
     @s = FFISpecs::LibTest::StructWithArray.new(FFISpecs::LibTest.struct_make_struct_with_array(0, 1, 2, 3, 4))
409 409
     @s[:a].to_a.should == [0, 1, 2, 3, 4]
410 410
   end
411 411
 
412  
-  it 'should cache array object for successive calls' do
  412
+  it "caches array object for successive calls" do
413 413
     @s[:a].object_id.should == @s[:a].object_id
414 414
   end
415 415
 
416  
-  it 'should return the size of the array field in bytes' do
  416
+  it "returns the size of the array field in bytes" do
417 417
     @s = FFISpecs::LibTest::StructWithArray.new(FFISpecs::LibTest.struct_make_struct_with_array(0, 1, 2, 3, 4))
418 418
     @s[:a].size.should == 20
419 419
   end
420 420
 
421  
-  it 'should allow iteration through the array elements' do
  421
+  it "iterates through the array elements" do
422 422
     @s = FFISpecs::LibTest::StructWithArray.new(FFISpecs::LibTest.struct_make_struct_with_array(0, 1, 2, 3, 4))
423 423
     @s[:a].each_with_index { |elem, i| elem.should == i }
424 424
   end
425 425
 
426  
-  it 'should return the pointer to the array' do
  426
+  it "returns the pointer to the array" do
427 427
     @s = FFISpecs::LibTest::StructWithArray.new(FFISpecs::LibTest.struct_make_struct_with_array(0, 1, 2, 3, 4))
428 428
     @s[:a].to_ptr.should == FFISpecs::LibTest::struct_field_array(@s.to_ptr)
429 429
   end
430 430
 end
431 431
 
432  
-describe 'BuggedStruct' do
433  
-  it 'should return its correct size' do
  432
+describe "BuggedStruct" do
  433
+  it "returns its correct size" do
434 434
     FFISpecs::LibTest::BuggedStruct.size.should == FFISpecs::LibTest.bugged_struct_size
435 435
   end
436 436
 
@@ -444,7 +444,7 @@ def self.int_field_test(type, values)
444 444
     FFISpecs::LibTest::BuggedStruct.offset_of(:size).should == 17
445 445
   end
446 446
 
447  
-  it 'should return correct field/offset pairs' do
  447
+  it "returns correct field/offset pairs" do
448 448
     FFISpecs::LibTest::BuggedStruct.offsets.sort do |a, b|
449 449
       a[1] <=> b[1]
450 450
     end.should == [[:visible, 0], [:x, 4], [:y, 8], [:rx, 12], [:ry, 14], [:order, 16], [:size, 17]]
10  optional/ffi/union_spec.rb
... ...
@@ -1,16 +1,16 @@
1 1
 require File.expand_path('../spec_helper', __FILE__)
2 2
 
3  
-describe 'Union' do
  3
+describe "Union" do
4 4
   before do
5 5
     @u = FFISpecs::LibTest::TestUnion.new
6 6
   end
7 7
 
8  
-  it 'should place all the fields at offset 0' do
  8
+  it "places all the fields at offset 0" do
9 9
     FFISpecs::LibTest::TestUnion.members.all? { |m| FFISpecs::LibTest::TestUnion.offset_of(m) == 0 }.should be_true
10 10
   end
11 11
 
12 12
   FFISpecs::LibTest::Types.each do |k, type|
13  
-    it "should correctly align/write a #{type[0]} value" do
  13
+    it "correctly aligns/writes a #{type[0]} value" do
14 14
       @u[type[1]] = type[2]
15 15
       if k == 'f32' or k == 'f64'
16 16
         (@u[type[1]] - FFISpecs::LibTest.send("union_align_#{k}", @u.to_ptr)).abs.should < 0.00001
@@ -21,7 +21,7 @@
21 21
   end
22 22
 
23 23
   FFISpecs::LibTest::Types.each do |k, type|
24  
-    it "should read a #{type[0]} value from memory" do
  24
+    it "reads a #{type[0]} value from memory" do
25 25
       @u = FFISpecs::LibTest::TestUnion.new(FFISpecs::LibTest.send("union_make_union_with_#{k}", type[2]))
26 26
       if k == 'f32' or k == 'f64'
27 27
         (@u[type[1]] - type[2]).abs.should < 0.00001
@@ -31,7 +31,7 @@
31 31
     end
32 32
   end
33 33
 
34  
-  it 'should return a size equals to the size of the biggest field' do
  34
+  it "returns a size equals to the size of the biggest field" do
35 35
     FFISpecs::LibTest::TestUnion.size.should == FFISpecs::LibTest.union_size
36 36
   end
37 37
 end
2  shared/complex/hash.rb
@@ -5,7 +5,7 @@
5 5
   # On 1.8 Complex(2, 1).hash == Complex(1, 2).hash
6 6
   # This can result in Bugs when using hash and
7 7
   # other stuff that relies on #hash
8  
-  it "should be static" do
  8
+  it "is static" do
9 9
     Complex(1).hash.should    == Complex(1).hash
10 10
     Complex(1, 0).hash.should == Complex(1).hash
11 11
     Complex(1, 1).hash.should == Complex(1, 1).hash

0 notes on commit fe344f4

Please sign in to comment.
Something went wrong with that request. Please try again.