linguistics 2.0.2 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +0 -0
  4. data/.simplecov +12 -0
  5. data/ChangeLog +773 -11
  6. data/History.rdoc +9 -0
  7. data/Manifest.txt +3 -2
  8. data/README.rdoc +5 -5
  9. data/Rakefile +49 -19
  10. data/examples/generalize_sentence.rb +2 -2
  11. data/lib/linguistics.rb +4 -4
  12. data/lib/linguistics/en/articles.rb +1 -1
  13. data/lib/linguistics/en/conjugation.rb +6 -6
  14. data/lib/linguistics/en/conjunctions.rb +1 -1
  15. data/lib/linguistics/en/infinitives.rb +1 -1
  16. data/lib/linguistics/en/linkparser.rb +11 -11
  17. data/lib/linguistics/en/numbers.rb +11 -11
  18. data/lib/linguistics/en/participles.rb +1 -1
  19. data/lib/linguistics/en/pluralization.rb +16 -16
  20. data/lib/linguistics/en/wordnet.rb +1 -1
  21. data/lib/linguistics/languagebehavior.rb +1 -1
  22. data/spec/{lib/constants.rb → constants.rb} +0 -0
  23. data/spec/helpers.rb +39 -0
  24. data/spec/linguistics/en/articles_spec.rb +194 -203
  25. data/spec/linguistics/en/conjugation_spec.rb +519 -521
  26. data/spec/linguistics/en/conjunctions_spec.rb +31 -47
  27. data/spec/linguistics/en/infinitives_spec.rb +193 -207
  28. data/spec/linguistics/en/linkparser_spec.rb +9 -20
  29. data/spec/linguistics/en/numbers_spec.rb +289 -302
  30. data/spec/linguistics/en/participles_spec.rb +6 -20
  31. data/spec/linguistics/en/pluralization_spec.rb +894 -908
  32. data/spec/linguistics/en/stemmer_spec.rb +10 -23
  33. data/spec/linguistics/en/titlecase_spec.rb +3 -13
  34. data/spec/linguistics/en/wordnet_spec.rb +10 -30
  35. data/spec/linguistics/en_spec.rb +14 -28
  36. data/spec/linguistics/inflector_spec.rb +3 -21
  37. data/spec/linguistics/iso639_spec.rb +28 -37
  38. data/spec/linguistics/monkeypatches_spec.rb +5 -14
  39. data/spec/linguistics_spec.rb +11 -30
  40. metadata +44 -15
  41. metadata.gz.sig +0 -0
  42. data/spec/lib/helpers.rb +0 -38
@@ -1,17 +1,8 @@
1
1
  #!/usr/bin/env spec -cfs
2
2
 
3
- BEGIN {
4
- require 'pathname'
5
- basedir = Pathname.new( __FILE__ ).dirname.parent.parent.parent
6
-
7
- libdir = basedir + "lib"
8
-
9
- $LOAD_PATH.unshift( basedir.to_s ) unless $LOAD_PATH.include?( basedir.to_s )
10
- $LOAD_PATH.unshift( libdir.to_s ) unless $LOAD_PATH.include?( libdir.to_s )
11
- }
3
+ require_relative '../../helpers'
12
4
 
13
5
  require 'rspec'
14
- require 'spec/lib/helpers'
15
6
 
16
7
  require 'linguistics'
17
8
  require 'linguistics/en'
@@ -21,17 +12,12 @@ require 'linguistics/en/stemmer'
21
12
  describe Linguistics::EN::Stemmer do
22
13
 
23
14
  before( :all ) do
24
- setup_logging()
25
15
  Linguistics.use( :en )
26
16
  end
27
17
 
28
- after( :all ) do
29
- reset_logging()
30
- end
31
-
32
18
 
33
19
  it "adds EN::Stemmer to the list of English language modules" do
34
- Linguistics::EN::MODULES.include?( Linguistics::EN::Stemmer )
20
+ expect( Linguistics::EN::MODULES ).to include( Linguistics::EN::Stemmer )
35
21
  end
36
22
 
37
23
 
@@ -43,7 +29,7 @@ describe Linguistics::EN::Stemmer do
43
29
  end
44
30
 
45
31
  it "can fetch the stem of a word" do
46
- "communication".en.stem.should == 'communic'
32
+ expect( "communication".en.stem ).to eq( 'communic' )
47
33
  end
48
34
 
49
35
  end
@@ -51,16 +37,17 @@ describe Linguistics::EN::Stemmer do
51
37
 
52
38
  describe "on a system that doesn't have the 'ruby-stemmer' library" do
53
39
 
54
- before( :all ) do
40
+ it "raises an NotImplementedError when you try to use stemmer functionality" do
55
41
  # If the system *does* have stemmer support, pretend it doesn't.
56
42
  if Linguistics::EN.has_stemmer?
57
- error = LoadError.new( "simulated exception: no such file to load -- lingua/stemmer" )
58
- Linguistics::EN::Stemmer.instance_variable_set( :@has_stemmer, false )
59
- Linguistics::EN::Stemmer.instance_variable_set( :@stemmer_error, error )
43
+ exception = LoadError.new( 'no such file to load -- lingua/stemmer' )
44
+
45
+ allow( Linguistics::EN::Stemmer ).to receive( :has_stemmer? ).
46
+ and_return( false )
47
+ allow( Linguistics::EN::Stemmer ).to receive( :stemmer_error ).
48
+ and_return( exception )
60
49
  end
61
- end
62
50
 
63
- it "raises an NotImplementedError when you try to use stemmer functionality" do
64
51
  expect {
65
52
  "communication".en.stem
66
53
  }.to raise_error( LoadError, %r{lingua/stemmer}i )
@@ -1,18 +1,9 @@
1
1
  #!/usr/bin/env rspec -cfd
2
2
  #coding: utf-8
3
3
 
4
- BEGIN {
5
- require 'pathname'
6
- basedir = Pathname.new( __FILE__ ).dirname.parent.parent.parent
7
-
8
- libdir = basedir + "lib"
9
-
10
- $LOAD_PATH.unshift( basedir.to_s ) unless $LOAD_PATH.include?( basedir.to_s )
11
- $LOAD_PATH.unshift( libdir.to_s ) unless $LOAD_PATH.include?( libdir.to_s )
12
- }
4
+ require_relative '../../helpers'
13
5
 
14
6
  require 'rspec'
15
- require 'spec/lib/helpers'
16
7
 
17
8
  require 'linguistics'
18
9
  require 'linguistics/en'
@@ -22,12 +13,11 @@ require 'linguistics/en/titlecase'
22
13
  describe Linguistics::EN::TitleCase do
23
14
 
24
15
  before( :all ) do
25
- setup_logging( :fatal )
26
16
  Linguistics.use( :en )
27
17
  end
28
18
 
29
- after( :all ) do
30
- reset_logging()
19
+ it "adds EN::TitleCase to the list of English language modules" do
20
+ Linguistics::EN::MODULES.include?( Linguistics::EN::TitleCase )
31
21
  end
32
22
 
33
23
  it "CamelCases 'motion is madness' correctly" do
@@ -1,17 +1,8 @@
1
1
  #!/usr/bin/env spec -cfs
2
2
 
3
- BEGIN {
4
- require 'pathname'
5
- basedir = Pathname.new( __FILE__ ).dirname.parent.parent.parent
6
-
7
- libdir = basedir + "lib"
8
-
9
- $LOAD_PATH.unshift( basedir.to_s ) unless $LOAD_PATH.include?( basedir.to_s )
10
- $LOAD_PATH.unshift( libdir.to_s ) unless $LOAD_PATH.include?( libdir.to_s )
11
- }
3
+ require_relative '../../helpers'
12
4
 
13
5
  require 'rspec'
14
- require 'spec/lib/helpers'
15
6
 
16
7
  require 'linguistics'
17
8
  require 'linguistics/en'
@@ -21,14 +12,9 @@ require 'linguistics/en/wordnet'
21
12
  describe Linguistics::EN::WordNet do
22
13
 
23
14
  before( :all ) do
24
- setup_logging()
25
15
  Linguistics.use( :en )
26
16
  end
27
17
 
28
- after( :all ) do
29
- reset_logging()
30
- end
31
-
32
18
 
33
19
  it "adds EN::WordNet to the list of English language modules" do
34
20
  Linguistics::EN::MODULES.include?( Linguistics::EN::WordNet )
@@ -43,37 +29,31 @@ describe Linguistics::EN::WordNet do
43
29
  end
44
30
 
45
31
  it "can create a WordNet::Synset from a word" do
46
- "jackal".en.synset.should be_a( WordNet::Synset )
32
+ expect( "jackal".en.synset ).to be_a( WordNet::Synset )
47
33
  end
48
34
 
49
35
  it "can load all synsets for a word" do
50
36
  result = "appear".en.synsets
51
- result.should have( 7 ).members
52
- result.should include( WordNet::Synset[200422090] )
37
+ expect( result ).to have( 7 ).members
38
+ expect( result ).to include( WordNet::Synset[200422090] )
53
39
  end
54
40
 
55
41
  end
56
42
 
57
43
 
58
44
  describe "on a system that doesn't have the 'wordnet' library" do
59
- before( :all ) do
45
+
46
+ it "raises the appropriate LoadError when you try to use wordnet functionality" do
60
47
  # If the system *does* have wordnet support, pretend it doesn't.
61
48
  if Linguistics::EN.has_wordnet?
62
- @had_wordnet = true
63
49
  error = LoadError.new( "no such file to load -- wordnet" )
64
- Linguistics::EN::WordNet.instance_variable_set( :@has_wordnet, false )
65
- Linguistics::EN::WordNet.instance_variable_set( :@wn_error, error )
66
- end
67
- end
68
50
 
69
- after( :all ) do
70
- if @had_wordnet
71
- Linguistics::EN::WordNet.instance_variable_set( :@has_wordnet, true )
72
- Linguistics::EN::WordNet.instance_variable_set( :@wn_error, nil )
51
+ allow( Linguistics::EN::WordNet ).to receive( :has_wordnet? ).
52
+ and_return( false )
53
+ allow( Linguistics::EN::WordNet ).to receive( :wordnet_error ).
54
+ and_return( error )
73
55
  end
74
- end
75
56
 
76
- it "raises the appropriate LoadError when you try to use wordnet functionality" do
77
57
  expect {
78
58
  "persimmon".en.synset
79
59
  }.to raise_error( LoadError, %r{wordnet}i )
@@ -1,17 +1,8 @@
1
1
  #!/usr/bin/env spec -cfs
2
2
 
3
- BEGIN {
4
- require 'pathname'
5
- basedir = Pathname.new( __FILE__ ).dirname.parent.parent
6
-
7
- libdir = basedir + "lib"
8
-
9
- $LOAD_PATH.unshift( basedir.to_s ) unless $LOAD_PATH.include?( basedir.to_s )
10
- $LOAD_PATH.unshift( libdir.to_s ) unless $LOAD_PATH.include?( libdir.to_s )
11
- }
3
+ require_relative '../helpers'
12
4
 
13
5
  require 'rspec'
14
- require 'spec/lib/helpers'
15
6
 
16
7
  require 'linguistics'
17
8
  require 'linguistics/en'
@@ -21,55 +12,50 @@ require 'linguistics/languagebehavior'
21
12
  describe Linguistics::EN do
22
13
 
23
14
  before( :all ) do
24
- setup_logging( :fatal )
25
15
  Linguistics.use( :en, :proxy => true )
26
16
  include Linguistics::EN
27
17
  end
28
18
 
29
- after( :all ) do
30
- reset_logging()
31
- end
32
-
33
19
 
34
20
  it_behaves_like "a Linguistics language module"
35
21
 
36
22
 
37
23
  it "provides a predicate for testing for the presence of modules by name" do
38
- Linguistics::EN.should_not have_extension( 'nonexistant' )
39
- Linguistics::EN.should have_extension( 'articles' )
24
+ expect( Linguistics::EN ).to_not have_extension( 'nonexistant' )
25
+ expect( Linguistics::EN ).to have_extension( 'articles' )
40
26
  end
41
27
 
42
28
  it "knows that it's not in 'classical' mode by default" do
43
- Linguistics::EN.should_not be_classical()
29
+ expect( Linguistics::EN ).to_not be_classical()
44
30
  end
45
31
 
46
32
  it "can run a single block in classical mode" do
47
33
  Linguistics::EN.in_classical_mode do
48
- Linguistics::EN.should be_classical()
34
+ expect( Linguistics::EN ).to be_classical()
49
35
  end
50
36
  end
51
37
 
52
38
  it "handles nested classical blocks correctly" do
53
39
  Linguistics::EN.in_classical_mode do
54
40
  Linguistics::EN.in_classical_mode do
55
- Linguistics::EN.should be_classical()
41
+ expect( Linguistics::EN ).to be_classical()
56
42
  end
57
- Linguistics::EN.should be_classical()
43
+ expect( Linguistics::EN ).to be_classical()
58
44
  end
59
- Linguistics::EN.should_not be_classical()
45
+ expect( Linguistics::EN ).to_not be_classical()
60
46
  end
61
47
 
62
48
 
63
49
  it "provides a sprintf-like function for interpolating variables into a String" do
64
- "I have %CONJUNCT.".en.lprintf( ["cat", "cat", "dog"] ).
65
- should == "I have two cats and a dog."
50
+ expect( "I have %CONJUNCT.".en.lprintf(["cat", "cat", "dog"]) ).
51
+ to eq( "I have two cats and a dog." )
66
52
  end
67
53
 
68
54
 
69
55
  context "lprintf formatters" do
70
56
 
71
57
  before( :all ) do
72
- @real_formatters = Linguistics::EN.lprintf_formatters
58
+ @real_formatters = Linguistics::EN.lprintf_formatters.dup
73
59
  end
74
60
 
75
61
  before( :each ) do
@@ -83,9 +69,9 @@ describe Linguistics::EN do
83
69
 
84
70
  it "provides a way to register new lprintf formatters with a Symbol" do
85
71
  Linguistics::EN.register_lprintf_formatter :TEST, :plural
86
- Linguistics::EN.lprintf_formatters.should have( 1 ).member
87
- Linguistics::EN.lprintf_formatters.should include( :TEST )
88
- Linguistics::EN.lprintf_formatters[ :TEST ].should be_a( Proc )
72
+ expect( Linguistics::EN.lprintf_formatters ).to have( 1 ).member
73
+ expect( Linguistics::EN.lprintf_formatters ).to include( :TEST )
74
+ expect( Linguistics::EN.lprintf_formatters[:TEST] ).to be_a( Proc )
89
75
  end
90
76
 
91
77
  end
@@ -1,17 +1,8 @@
1
1
  #!/usr/bin/env spec -cfs
2
2
 
3
- BEGIN {
4
- require 'pathname'
5
- basedir = Pathname.new( __FILE__ ).dirname.parent.parent
6
-
7
- libdir = basedir + "lib"
8
-
9
- $LOAD_PATH.unshift( basedir.to_s ) unless $LOAD_PATH.include?( basedir.to_s )
10
- $LOAD_PATH.unshift( libdir.to_s ) unless $LOAD_PATH.include?( libdir.to_s )
11
- }
3
+ require_relative '../helpers'
12
4
 
13
5
  require 'rspec'
14
- require 'spec/lib/helpers'
15
6
 
16
7
  require 'linguistics'
17
8
  require 'linguistics/inflector'
@@ -19,21 +10,12 @@ require 'linguistics/inflector'
19
10
 
20
11
  describe Linguistics::Inflector do
21
12
 
22
- before( :all ) do
23
- setup_logging( :fatal )
24
- end
25
-
26
- after( :all ) do
27
- reset_logging()
28
- end
29
-
30
-
31
13
  it "provides a human-readable representation of the object suitable for debugging" do
32
14
  obj = Object.new
33
15
  result = Linguistics::Inflector.new( :en, obj ).inspect
34
16
 
35
- result.should include( (obj.object_id / 2).to_s(16) )
36
- result.should =~ /english-language/i
17
+ expect( result ).to include( (obj.object_id / 2).to_s(16) )
18
+ expect( result ).to match( /english-language/i )
37
19
  end
38
20
 
39
21
  end
@@ -1,18 +1,9 @@
1
1
  #!/usr/bin/env spec -cfs
2
2
  #encoding: utf-8
3
3
 
4
- BEGIN {
5
- require 'pathname'
6
- basedir = Pathname.new( __FILE__ ).dirname.parent.parent
7
-
8
- libdir = basedir + "lib"
9
-
10
- $LOAD_PATH.unshift( basedir.to_s ) unless $LOAD_PATH.include?( basedir.to_s )
11
- $LOAD_PATH.unshift( libdir.to_s ) unless $LOAD_PATH.include?( libdir.to_s )
12
- }
4
+ require_relative '../helpers'
13
5
 
14
6
  require 'rspec'
15
- require 'spec/lib/helpers'
16
7
 
17
8
  require 'linguistics'
18
9
  require 'linguistics/iso639'
@@ -22,46 +13,46 @@ describe Linguistics::ISO639 do
22
13
 
23
14
  # eng||en|English|anglais
24
15
  it "loads simple language codes from its __DATA__ section" do
25
- Linguistics::LANGUAGE_CODES.should have_key( :en )
26
- Linguistics::LANGUAGE_CODES[ :en ].should have(3).members
16
+ expect( Linguistics::LANGUAGE_CODES ).to have_key( :en )
17
+ expect( Linguistics::LANGUAGE_CODES[:en] ).to have(3).members
27
18
 
28
- Linguistics::LANGUAGE_CODES[ :en ].should have_key( :codes )
29
- Linguistics::LANGUAGE_CODES[ :en ][:codes].should have(2).members
30
- Linguistics::LANGUAGE_CODES[ :en ][:codes].should include("en", "eng")
19
+ expect( Linguistics::LANGUAGE_CODES[:en] ).to have_key( :codes )
20
+ expect( Linguistics::LANGUAGE_CODES[:en][:codes] ).to have(2).members
21
+ expect( Linguistics::LANGUAGE_CODES[:en][:codes] ).to include("en", "eng")
31
22
 
32
- Linguistics::LANGUAGE_CODES[ :en ].should have_key( :eng_name )
33
- Linguistics::LANGUAGE_CODES[ :en ][:eng_name].should == 'English'
34
- Linguistics::LANGUAGE_CODES[ :en ].should have_key( :fre_name )
35
- Linguistics::LANGUAGE_CODES[ :en ][:fre_name].should == 'anglais'
23
+ expect( Linguistics::LANGUAGE_CODES[:en] ).to have_key( :eng_name )
24
+ expect( Linguistics::LANGUAGE_CODES[:en][:eng_name] ).to eq( 'English' )
25
+ expect( Linguistics::LANGUAGE_CODES[:en] ).to have_key( :fre_name )
26
+ expect( Linguistics::LANGUAGE_CODES[:en][:fre_name] ).to eq( 'anglais' )
36
27
  end
37
28
 
38
29
  it "loads language codes with variants from its __DATA__ section" do
39
30
 
40
31
  # cze|ces|cs|Czech|tchèque
41
- Linguistics::LANGUAGE_CODES.should have_key( :cs )
42
- Linguistics::LANGUAGE_CODES[ :cs ].should have(3).members
32
+ expect( Linguistics::LANGUAGE_CODES ).to have_key( :cs )
33
+ expect( Linguistics::LANGUAGE_CODES[:cs] ).to have(3).members
43
34
 
44
- Linguistics::LANGUAGE_CODES[ :cs ].should have_key( :codes )
45
- Linguistics::LANGUAGE_CODES[ :cs ][:codes].should have(3).members
46
- Linguistics::LANGUAGE_CODES[ :cs ][:codes].should include("cs", "ces", "cze")
35
+ expect( Linguistics::LANGUAGE_CODES[:cs] ).to have_key( :codes )
36
+ expect( Linguistics::LANGUAGE_CODES[:cs][:codes] ).to have(3).members
37
+ expect( Linguistics::LANGUAGE_CODES[:cs][:codes] ).to include("cs", "ces", "cze")
47
38
 
48
- Linguistics::LANGUAGE_CODES[ :cs ].should have_key( :eng_name )
49
- Linguistics::LANGUAGE_CODES[ :cs ][:eng_name].should == 'Czech'
50
- Linguistics::LANGUAGE_CODES[ :cs ].should have_key( :fre_name )
51
- Linguistics::LANGUAGE_CODES[ :cs ][:fre_name].should == 'tchèque'
39
+ expect( Linguistics::LANGUAGE_CODES[:cs] ).to have_key( :eng_name )
40
+ expect( Linguistics::LANGUAGE_CODES[:cs][:eng_name] ).to eq( 'Czech' )
41
+ expect( Linguistics::LANGUAGE_CODES[:cs] ).to have_key( :fre_name )
42
+ expect( Linguistics::LANGUAGE_CODES[:cs][:fre_name] ).to eq( 'tchèque' )
52
43
 
53
44
  # mac|mkd|mk|Macedonian|macédonien
54
- Linguistics::LANGUAGE_CODES.should have_key( :mk )
55
- Linguistics::LANGUAGE_CODES[ :mk ].should have( 3 ).members
45
+ expect( Linguistics::LANGUAGE_CODES ).to have_key( :mk )
46
+ expect( Linguistics::LANGUAGE_CODES[:mk] ).to have( 3 ).members
56
47
 
57
- Linguistics::LANGUAGE_CODES[ :mk ].should have_key( :codes )
58
- Linguistics::LANGUAGE_CODES[ :mk ][:codes].should have(3).members
59
- Linguistics::LANGUAGE_CODES[ :mk ][:codes].should include("mk", "mac", "mkd")
48
+ expect( Linguistics::LANGUAGE_CODES[:mk] ).to have_key( :codes )
49
+ expect( Linguistics::LANGUAGE_CODES[:mk][:codes] ).to have(3).members
50
+ expect( Linguistics::LANGUAGE_CODES[:mk][:codes] ).to include("mk", "mac", "mkd")
60
51
 
61
- Linguistics::LANGUAGE_CODES[ :mk ].should have_key( :eng_name )
62
- Linguistics::LANGUAGE_CODES[ :mk ][:eng_name].should == 'Macedonian'
63
- Linguistics::LANGUAGE_CODES[ :mk ].should have_key( :fre_name )
64
- Linguistics::LANGUAGE_CODES[ :mk ][:fre_name].should == 'macédonien'
52
+ expect( Linguistics::LANGUAGE_CODES[:mk] ).to have_key( :eng_name )
53
+ expect( Linguistics::LANGUAGE_CODES[:mk][:eng_name] ).to eq( 'Macedonian' )
54
+ expect( Linguistics::LANGUAGE_CODES[:mk] ).to have_key( :fre_name )
55
+ expect( Linguistics::LANGUAGE_CODES[:mk][:fre_name] ).to eq( 'macédonien' )
65
56
 
66
57
  end
67
58
 
@@ -1,17 +1,8 @@
1
1
  #!/usr/bin/env spec -cfs
2
2
 
3
- BEGIN {
4
- require 'pathname'
5
- basedir = Pathname.new( __FILE__ ).dirname.parent.parent
6
-
7
- libdir = basedir + "lib"
8
-
9
- $LOAD_PATH.unshift( basedir.to_s ) unless $LOAD_PATH.include?( basedir.to_s )
10
- $LOAD_PATH.unshift( libdir.to_s ) unless $LOAD_PATH.include?( libdir.to_s )
11
- }
3
+ require_relative '../helpers'
12
4
 
13
5
  require 'rspec'
14
- require 'spec/lib/helpers'
15
6
 
16
7
  require 'linguistics'
17
8
  require 'linguistics/monkeypatches'
@@ -21,20 +12,20 @@ describe Array, "extended with Linguistics::ArrayExtensions" do
21
12
 
22
13
  it "can return a copy of itself with a separator between each element" do
23
14
  ary = %w[one two three]
24
- ary.separate( 'and' ).should == [ 'one', 'and', 'two', 'and', 'three' ]
15
+ expect( ary.separate( 'and' ) ).to eq([ 'one', 'and', 'two', 'and', 'three' ])
25
16
  end
26
17
 
27
18
  it "can return a copy of itself with each element separated by the return value of a block" do
28
19
  ary = %w[thumpy lippy barky tiger]
29
20
  result = ary.separate {|left, right| (left > right) ? '>' : '<' }
30
- result.should == [ 'thumpy', '>', 'lippy', '>', 'barky', '<', 'tiger' ]
21
+ expect( result ).to eq([ 'thumpy', '>', 'lippy', '>', 'barky', '<', 'tiger' ])
31
22
  end
32
23
 
33
24
  it "provides a mutator variant of #separate" do
34
25
  ary = %w[one two three]
35
26
  result = ary.separate!( nil )
36
- result.should equal( ary )
37
- result.should == [ 'one', nil, 'two', nil, 'three' ]
27
+ expect( result ).to equal( ary )
28
+ expect( result ).to eq([ 'one', nil, 'two', nil, 'three' ])
38
29
  end
39
30
 
40
31
  end