ruby_speech 2.4.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +1 -0
  3. data/.travis.yml +11 -23
  4. data/CHANGELOG.md +4 -0
  5. data/README.md +2 -2
  6. data/Rakefile +2 -0
  7. data/lib/ruby_speech/version.rb +1 -1
  8. data/ruby_speech.gemspec +3 -3
  9. data/spec/ruby_speech/grxml/builtins_spec.rb +72 -72
  10. data/spec/ruby_speech/grxml/grammar_spec.rb +37 -37
  11. data/spec/ruby_speech/grxml/item_spec.rb +33 -33
  12. data/spec/ruby_speech/grxml/match_spec.rb +1 -1
  13. data/spec/ruby_speech/grxml/matcher_spec.rb +62 -62
  14. data/spec/ruby_speech/grxml/max_match_spec.rb +2 -2
  15. data/spec/ruby_speech/grxml/no_match_spec.rb +2 -2
  16. data/spec/ruby_speech/grxml/one_of_spec.rb +6 -6
  17. data/spec/ruby_speech/grxml/potential_match_spec.rb +2 -2
  18. data/spec/ruby_speech/grxml/rule_spec.rb +17 -17
  19. data/spec/ruby_speech/grxml/ruleref_spec.rb +10 -10
  20. data/spec/ruby_speech/grxml/tag_spec.rb +5 -5
  21. data/spec/ruby_speech/grxml/token_spec.rb +7 -7
  22. data/spec/ruby_speech/grxml_spec.rb +24 -24
  23. data/spec/ruby_speech/nlsml_spec.rb +11 -11
  24. data/spec/ruby_speech/ssml/audio_spec.rb +19 -19
  25. data/spec/ruby_speech/ssml/break_spec.rb +16 -16
  26. data/spec/ruby_speech/ssml/desc_spec.rb +7 -7
  27. data/spec/ruby_speech/ssml/emphasis_spec.rb +21 -21
  28. data/spec/ruby_speech/ssml/mark_spec.rb +5 -5
  29. data/spec/ruby_speech/ssml/p_spec.rb +17 -17
  30. data/spec/ruby_speech/ssml/phoneme_spec.rb +8 -8
  31. data/spec/ruby_speech/ssml/prosody_spec.rb +61 -61
  32. data/spec/ruby_speech/ssml/s_spec.rb +16 -16
  33. data/spec/ruby_speech/ssml/say_as_spec.rb +9 -9
  34. data/spec/ruby_speech/ssml/speak_spec.rb +29 -29
  35. data/spec/ruby_speech/ssml/sub_spec.rb +7 -7
  36. data/spec/ruby_speech/ssml/voice_spec.rb +31 -31
  37. data/spec/ruby_speech/ssml_spec.rb +20 -20
  38. data/spec/ruby_speech_spec.rb +3 -3
  39. data/spec/spec_helper.rb +0 -1
  40. data/spec/support/grammar_matchers.rb +6 -6
  41. data/spec/support/match_examples.rb +5 -5
  42. data/spec/support/matchers.rb +1 -1
  43. metadata +17 -11
@@ -16,7 +16,7 @@ module RubySpeech
16
16
  end
17
17
 
18
18
  it 'registers itself' do
19
- Element.class_from_registration(:mark).should == Mark
19
+ expect(Element.class_from_registration(:mark)).to eq(Mark)
20
20
  end
21
21
 
22
22
  describe "from a document" do
@@ -24,7 +24,7 @@ module RubySpeech
24
24
 
25
25
  subject { Element.import document }
26
26
 
27
- it { should be_instance_of Mark }
27
+ it { is_expected.to be_instance_of Mark }
28
28
 
29
29
  its(:name) { should == 'foo' }
30
30
  end
@@ -37,18 +37,18 @@ module RubySpeech
37
37
 
38
38
  describe "<<" do
39
39
  it "should always raise InvalidChildError" do
40
- lambda { subject << 'anything' }.should raise_error(InvalidChildError, "A Mark cannot contain children")
40
+ expect { subject << 'anything' }.to raise_error(InvalidChildError, "A Mark cannot contain children")
41
41
  end
42
42
  end
43
43
 
44
44
  describe "comparing objects" do
45
45
  it "should be equal if the name is the same" do
46
- Mark.new(doc, :name => "foo").should == Mark.new(doc, :name => "foo")
46
+ expect(Mark.new(doc, :name => "foo")).to eq(Mark.new(doc, :name => "foo"))
47
47
  end
48
48
 
49
49
  describe "when the name is different" do
50
50
  it "should not be equal" do
51
- Mark.new(doc, :name => "foo").should_not == Mark.new(doc, :name => "bar")
51
+ expect(Mark.new(doc, :name => "foo")).not_to eq(Mark.new(doc, :name => "bar"))
52
52
  end
53
53
  end
54
54
  end
@@ -16,7 +16,7 @@ module RubySpeech
16
16
  end
17
17
 
18
18
  it 'registers itself' do
19
- Element.class_from_registration(:p).should == P
19
+ expect(Element.class_from_registration(:p)).to eq(P)
20
20
  end
21
21
 
22
22
  describe "from a document" do
@@ -24,75 +24,75 @@ module RubySpeech
24
24
 
25
25
  subject { Element.import document }
26
26
 
27
- it { should be_instance_of P }
27
+ it { is_expected.to be_instance_of P }
28
28
  its(:content) { should == 'foo' }
29
29
  end
30
30
 
31
31
  describe "comparing objects" do
32
32
  it "should be equal if the content and language are the same" do
33
- P.new(doc, :language => 'jp', :content => "Hello there").should == P.new(doc, :language => 'jp', :content => "Hello there")
33
+ expect(P.new(doc, :language => 'jp', :content => "Hello there")).to eq(P.new(doc, :language => 'jp', :content => "Hello there"))
34
34
  end
35
35
 
36
36
  describe "when the content is different" do
37
37
  it "should not be equal" do
38
- P.new(doc, :content => "Hello").should_not == P.new(doc, :content => "Hello there")
38
+ expect(P.new(doc, :content => "Hello")).not_to eq(P.new(doc, :content => "Hello there"))
39
39
  end
40
40
  end
41
41
 
42
42
  describe "when the language is different" do
43
43
  it "should not be equal" do
44
- P.new(doc, :language => 'jp').should_not == P.new(doc, :language => 'en')
44
+ expect(P.new(doc, :language => 'jp')).not_to eq(P.new(doc, :language => 'en'))
45
45
  end
46
46
  end
47
47
  end
48
48
 
49
49
  describe "<<" do
50
50
  it "should accept String" do
51
- lambda { subject << 'anything' }.should_not raise_error
51
+ expect { subject << 'anything' }.not_to raise_error
52
52
  end
53
53
 
54
54
  it "should accept Audio" do
55
- lambda { subject << Audio.new(doc) }.should_not raise_error
55
+ expect { subject << Audio.new(doc) }.not_to raise_error
56
56
  end
57
57
 
58
58
  it "should accept Break" do
59
- lambda { subject << Break.new(doc) }.should_not raise_error
59
+ expect { subject << Break.new(doc) }.not_to raise_error
60
60
  end
61
61
 
62
62
  it "should accept Emphasis" do
63
- lambda { subject << Emphasis.new(doc) }.should_not raise_error
63
+ expect { subject << Emphasis.new(doc) }.not_to raise_error
64
64
  end
65
65
 
66
66
  it "should accept Mark" do
67
- lambda { subject << Mark.new(doc) }.should_not raise_error
67
+ expect { subject << Mark.new(doc) }.not_to raise_error
68
68
  end
69
69
 
70
70
  it "should accept Phoneme" do
71
- lambda { subject << Phoneme.new(doc) }.should_not raise_error
71
+ expect { subject << Phoneme.new(doc) }.not_to raise_error
72
72
  end
73
73
 
74
74
  it "should accept Prosody" do
75
- lambda { subject << Prosody.new(doc) }.should_not raise_error
75
+ expect { subject << Prosody.new(doc) }.not_to raise_error
76
76
  end
77
77
 
78
78
  it "should accept SayAs" do
79
- lambda { subject << SayAs.new(doc, :interpret_as => :foo) }.should_not raise_error
79
+ expect { subject << SayAs.new(doc, :interpret_as => :foo) }.not_to raise_error
80
80
  end
81
81
 
82
82
  it "should accept Sub" do
83
- lambda { subject << Sub.new(doc) }.should_not raise_error
83
+ expect { subject << Sub.new(doc) }.not_to raise_error
84
84
  end
85
85
 
86
86
  it "should accept S" do
87
- lambda { subject << S.new(doc) }.should_not raise_error
87
+ expect { subject << S.new(doc) }.not_to raise_error
88
88
  end
89
89
 
90
90
  it "should accept Voice" do
91
- lambda { subject << Voice.new(doc) }.should_not raise_error
91
+ expect { subject << Voice.new(doc) }.not_to raise_error
92
92
  end
93
93
 
94
94
  it "should raise InvalidChildError with non-acceptable objects" do
95
- lambda { subject << 1 }.should raise_error(InvalidChildError, "A P can only accept String, Audio, Break, Emphasis, Mark, Phoneme, Prosody, SayAs, Sub, S, Voice as children")
95
+ expect { subject << 1 }.to raise_error(InvalidChildError, "A P can only accept String, Audio, Break, Emphasis, Mark, Phoneme, Prosody, SayAs, Sub, S, Voice as children")
96
96
  end
97
97
  end
98
98
  end # P
@@ -17,7 +17,7 @@ module RubySpeech
17
17
  end
18
18
 
19
19
  it 'registers itself' do
20
- Element.class_from_registration(:phoneme).should == Phoneme
20
+ expect(Element.class_from_registration(:phoneme)).to eq(Phoneme)
21
21
  end
22
22
 
23
23
  describe "from a document" do
@@ -25,7 +25,7 @@ module RubySpeech
25
25
 
26
26
  subject { Element.import document }
27
27
 
28
- it { should be_instance_of Phoneme }
28
+ it { is_expected.to be_instance_of Phoneme }
29
29
 
30
30
  its(:alphabet) { should == 'foo' }
31
31
  its(:ph) { should == 'bar' }
@@ -33,35 +33,35 @@ module RubySpeech
33
33
 
34
34
  describe "comparing objects" do
35
35
  it "should be equal if the content, ph and alphabet are the same" do
36
- Phoneme.new(doc, :alphabet => 'jp', :ph => 'foo', :content => "Hello there").should == Phoneme.new(doc, :alphabet => 'jp', :ph => 'foo', :content => "Hello there")
36
+ expect(Phoneme.new(doc, :alphabet => 'jp', :ph => 'foo', :content => "Hello there")).to eq(Phoneme.new(doc, :alphabet => 'jp', :ph => 'foo', :content => "Hello there"))
37
37
  end
38
38
 
39
39
  describe "when the content is different" do
40
40
  it "should not be equal" do
41
- Phoneme.new(doc, :content => "Hello").should_not == Phoneme.new(doc, :content => "Hello there")
41
+ expect(Phoneme.new(doc, :content => "Hello")).not_to eq(Phoneme.new(doc, :content => "Hello there"))
42
42
  end
43
43
  end
44
44
 
45
45
  describe "when the ph is different" do
46
46
  it "should not be equal" do
47
- Phoneme.new(doc, :ph => 'jp').should_not == Phoneme.new(doc, :ph => 'en')
47
+ expect(Phoneme.new(doc, :ph => 'jp')).not_to eq(Phoneme.new(doc, :ph => 'en'))
48
48
  end
49
49
  end
50
50
 
51
51
  describe "when the alphabet is different" do
52
52
  it "should not be equal" do
53
- Phoneme.new(doc, :alphabet => 'jp').should_not == Phoneme.new(doc, :alphabet => 'en')
53
+ expect(Phoneme.new(doc, :alphabet => 'jp')).not_to eq(Phoneme.new(doc, :alphabet => 'en'))
54
54
  end
55
55
  end
56
56
  end
57
57
 
58
58
  describe "<<" do
59
59
  it "should accept String" do
60
- lambda { subject << 'anything' }.should_not raise_error
60
+ expect { subject << 'anything' }.not_to raise_error
61
61
  end
62
62
 
63
63
  it "should raise InvalidChildError with non-acceptable objects" do
64
- lambda { subject << Voice.new(doc) }.should raise_error(InvalidChildError, "A Phoneme can only accept Strings as children")
64
+ expect { subject << Voice.new(doc) }.to raise_error(InvalidChildError, "A Phoneme can only accept Strings as children")
65
65
  end
66
66
  end
67
67
  end # Desc
@@ -21,7 +21,7 @@ module RubySpeech
21
21
  end
22
22
 
23
23
  it 'registers itself' do
24
- Element.class_from_registration(:prosody).should == Prosody
24
+ expect(Element.class_from_registration(:prosody)).to eq(Prosody)
25
25
  end
26
26
 
27
27
  describe "from a document" do
@@ -29,7 +29,7 @@ module RubySpeech
29
29
 
30
30
  subject { Element.import document }
31
31
 
32
- it { should be_instance_of Prosody }
32
+ it { is_expected.to be_instance_of Prosody }
33
33
 
34
34
  its(:pitch) { should == :medium }
35
35
  its(:contour) { should == 'something' }
@@ -46,16 +46,16 @@ module RubySpeech
46
46
  its(:pitch) { should == :medium }
47
47
 
48
48
  it "with a valid value" do
49
- lambda { subject.pitch = :'x-low' }.should_not raise_error
50
- lambda { subject.pitch = :low }.should_not raise_error
51
- lambda { subject.pitch = :medium }.should_not raise_error
52
- lambda { subject.pitch = :high }.should_not raise_error
53
- lambda { subject.pitch = :'x-high' }.should_not raise_error
54
- lambda { subject.pitch = :default }.should_not raise_error
49
+ expect { subject.pitch = :'x-low' }.not_to raise_error
50
+ expect { subject.pitch = :low }.not_to raise_error
51
+ expect { subject.pitch = :medium }.not_to raise_error
52
+ expect { subject.pitch = :high }.not_to raise_error
53
+ expect { subject.pitch = :'x-high' }.not_to raise_error
54
+ expect { subject.pitch = :default }.not_to raise_error
55
55
  end
56
56
 
57
57
  it "with an invalid value" do
58
- lambda { subject.pitch = :something }.should raise_error(ArgumentError, "You must specify a valid pitch (\"[positive-number]Hz\", :\"x-low\", :low, :medium, :high, :\"x-high\", :default)")
58
+ expect { subject.pitch = :something }.to raise_error(ArgumentError, "You must specify a valid pitch (\"[positive-number]Hz\", :\"x-low\", :low, :medium, :high, :\"x-high\", :default)")
59
59
  end
60
60
  end
61
61
 
@@ -67,11 +67,11 @@ module RubySpeech
67
67
  end
68
68
 
69
69
  it "with a negative value" do
70
- lambda { subject.pitch = "-100Hz" }.should raise_error(ArgumentError, "You must specify a valid pitch (\"[positive-number]Hz\", :\"x-low\", :low, :medium, :high, :\"x-high\", :default)")
70
+ expect { subject.pitch = "-100Hz" }.to raise_error(ArgumentError, "You must specify a valid pitch (\"[positive-number]Hz\", :\"x-low\", :low, :medium, :high, :\"x-high\", :default)")
71
71
  end
72
72
 
73
73
  it "when missing 'hz'" do
74
- lambda { subject.pitch = "440" }.should raise_error(ArgumentError, "You must specify a valid pitch (\"[positive-number]Hz\", :\"x-low\", :low, :medium, :high, :\"x-high\", :default)")
74
+ expect { subject.pitch = "440" }.to raise_error(ArgumentError, "You must specify a valid pitch (\"[positive-number]Hz\", :\"x-low\", :low, :medium, :high, :\"x-high\", :default)")
75
75
  end
76
76
  end
77
77
  end
@@ -89,16 +89,16 @@ module RubySpeech
89
89
  its(:range) { should == :medium }
90
90
 
91
91
  it "with a valid value" do
92
- lambda { subject.range = :'x-low' }.should_not raise_error
93
- lambda { subject.range = :low }.should_not raise_error
94
- lambda { subject.range = :medium }.should_not raise_error
95
- lambda { subject.range = :high }.should_not raise_error
96
- lambda { subject.range = :'x-high' }.should_not raise_error
97
- lambda { subject.range = :default }.should_not raise_error
92
+ expect { subject.range = :'x-low' }.not_to raise_error
93
+ expect { subject.range = :low }.not_to raise_error
94
+ expect { subject.range = :medium }.not_to raise_error
95
+ expect { subject.range = :high }.not_to raise_error
96
+ expect { subject.range = :'x-high' }.not_to raise_error
97
+ expect { subject.range = :default }.not_to raise_error
98
98
  end
99
99
 
100
100
  it "with an invalid value" do
101
- lambda { subject.range = :something }.should raise_error(ArgumentError, "You must specify a valid range (\"[positive-number]Hz\", :\"x-low\", :low, :medium, :high, :\"x-high\", :default)")
101
+ expect { subject.range = :something }.to raise_error(ArgumentError, "You must specify a valid range (\"[positive-number]Hz\", :\"x-low\", :low, :medium, :high, :\"x-high\", :default)")
102
102
  end
103
103
  end
104
104
 
@@ -110,11 +110,11 @@ module RubySpeech
110
110
  end
111
111
 
112
112
  it "with a negative value" do
113
- lambda { subject.range = "-100Hz" }.should raise_error(ArgumentError, "You must specify a valid range (\"[positive-number]Hz\", :\"x-low\", :low, :medium, :high, :\"x-high\", :default)")
113
+ expect { subject.range = "-100Hz" }.to raise_error(ArgumentError, "You must specify a valid range (\"[positive-number]Hz\", :\"x-low\", :low, :medium, :high, :\"x-high\", :default)")
114
114
  end
115
115
 
116
116
  it "when missing 'hz'" do
117
- lambda { subject.range = "440" }.should raise_error(ArgumentError, "You must specify a valid range (\"[positive-number]Hz\", :\"x-low\", :low, :medium, :high, :\"x-high\", :default)")
117
+ expect { subject.range = "440" }.to raise_error(ArgumentError, "You must specify a valid range (\"[positive-number]Hz\", :\"x-low\", :low, :medium, :high, :\"x-high\", :default)")
118
118
  end
119
119
  end
120
120
  end
@@ -126,16 +126,16 @@ module RubySpeech
126
126
  its(:rate) { should == :medium }
127
127
 
128
128
  it "with a valid value" do
129
- lambda { subject.rate = :'x-slow' }.should_not raise_error
130
- lambda { subject.rate = :slow }.should_not raise_error
131
- lambda { subject.rate = :medium }.should_not raise_error
132
- lambda { subject.rate = :fast }.should_not raise_error
133
- lambda { subject.rate = :'x-fast' }.should_not raise_error
134
- lambda { subject.rate = :default }.should_not raise_error
129
+ expect { subject.rate = :'x-slow' }.not_to raise_error
130
+ expect { subject.rate = :slow }.not_to raise_error
131
+ expect { subject.rate = :medium }.not_to raise_error
132
+ expect { subject.rate = :fast }.not_to raise_error
133
+ expect { subject.rate = :'x-fast' }.not_to raise_error
134
+ expect { subject.rate = :default }.not_to raise_error
135
135
  end
136
136
 
137
137
  it "with an invalid value" do
138
- lambda { subject.rate = :something }.should raise_error(ArgumentError, "You must specify a valid rate ([positive-number](multiplier), :\"x-slow\", :slow, :medium, :fast, :\"x-fast\", :default)")
138
+ expect { subject.rate = :something }.to raise_error(ArgumentError, "You must specify a valid rate ([positive-number](multiplier), :\"x-slow\", :slow, :medium, :fast, :\"x-fast\", :default)")
139
139
  end
140
140
  end
141
141
 
@@ -147,7 +147,7 @@ module RubySpeech
147
147
  end
148
148
 
149
149
  it "with a negative value" do
150
- lambda { subject.rate = -100 }.should raise_error(ArgumentError, "You must specify a valid rate ([positive-number](multiplier), :\"x-slow\", :slow, :medium, :fast, :\"x-fast\", :default)")
150
+ expect { subject.rate = -100 }.to raise_error(ArgumentError, "You must specify a valid rate ([positive-number](multiplier), :\"x-slow\", :slow, :medium, :fast, :\"x-fast\", :default)")
151
151
  end
152
152
 
153
153
  describe "with a percentage" do
@@ -179,13 +179,13 @@ module RubySpeech
179
179
 
180
180
  context "with a negative value" do
181
181
  it do
182
- lambda { subject.duration = -3 }.should raise_error(ArgumentError, "You must specify a valid duration (positive float value in seconds)")
182
+ expect { subject.duration = -3 }.to raise_error(ArgumentError, "You must specify a valid duration (positive float value in seconds)")
183
183
  end
184
184
  end
185
185
 
186
186
  context "with an invalid value" do
187
187
  it do
188
- lambda { subject.duration = 'blah' }.should raise_error(ArgumentError, "You must specify a valid duration (positive float value in seconds)")
188
+ expect { subject.duration = 'blah' }.to raise_error(ArgumentError, "You must specify a valid duration (positive float value in seconds)")
189
189
  end
190
190
  end
191
191
  end
@@ -197,17 +197,17 @@ module RubySpeech
197
197
  its(:volume) { should == :medium }
198
198
 
199
199
  it "with a valid value" do
200
- lambda { subject.volume = :silent }.should_not raise_error
201
- lambda { subject.volume = :'x-soft' }.should_not raise_error
202
- lambda { subject.volume = :soft }.should_not raise_error
203
- lambda { subject.volume = :medium }.should_not raise_error
204
- lambda { subject.volume = :loud }.should_not raise_error
205
- lambda { subject.volume = :'x-loud' }.should_not raise_error
206
- lambda { subject.volume = :default }.should_not raise_error
200
+ expect { subject.volume = :silent }.not_to raise_error
201
+ expect { subject.volume = :'x-soft' }.not_to raise_error
202
+ expect { subject.volume = :soft }.not_to raise_error
203
+ expect { subject.volume = :medium }.not_to raise_error
204
+ expect { subject.volume = :loud }.not_to raise_error
205
+ expect { subject.volume = :'x-loud' }.not_to raise_error
206
+ expect { subject.volume = :default }.not_to raise_error
207
207
  end
208
208
 
209
209
  it "with an invalid value" do
210
- lambda { subject.volume = :something }.should raise_error(ArgumentError, "You must specify a valid volume ([positive-number](0.0 -> 100.0), :silent, :\"x-soft\", :soft, :medium, :loud, :\"x-loud\", :default)")
210
+ expect { subject.volume = :something }.to raise_error(ArgumentError, "You must specify a valid volume ([positive-number](0.0 -> 100.0), :silent, :\"x-soft\", :soft, :medium, :loud, :\"x-loud\", :default)")
211
211
  end
212
212
  end
213
213
 
@@ -219,111 +219,111 @@ module RubySpeech
219
219
  end
220
220
 
221
221
  it "with a negative value" do
222
- lambda { subject.volume = -1.5 }.should raise_error(ArgumentError, "You must specify a valid volume ([positive-number](0.0 -> 100.0), :silent, :\"x-soft\", :soft, :medium, :loud, :\"x-loud\", :default)")
223
- lambda { subject.volume = 100.5 }.should raise_error(ArgumentError, "You must specify a valid volume ([positive-number](0.0 -> 100.0), :silent, :\"x-soft\", :soft, :medium, :loud, :\"x-loud\", :default)")
222
+ expect { subject.volume = -1.5 }.to raise_error(ArgumentError, "You must specify a valid volume ([positive-number](0.0 -> 100.0), :silent, :\"x-soft\", :soft, :medium, :loud, :\"x-loud\", :default)")
223
+ expect { subject.volume = 100.5 }.to raise_error(ArgumentError, "You must specify a valid volume ([positive-number](0.0 -> 100.0), :silent, :\"x-soft\", :soft, :medium, :loud, :\"x-loud\", :default)")
224
224
  end
225
225
  end
226
226
  end
227
227
 
228
228
  describe "comparing objects" do
229
229
  it "should be equal if the content, strength and base uri are the same" do
230
- Prosody.new(doc, :pitch => :medium, :contour => "something", :range => '20Hz', :rate => 2, :duration => 10, :volume => :loud, :content => "Hello there").should == Prosody.new(doc, :pitch => :medium, :contour => "something", :range => '20Hz', :rate => 2, :duration => 10, :volume => :loud, :content => "Hello there")
230
+ expect(Prosody.new(doc, :pitch => :medium, :contour => "something", :range => '20Hz', :rate => 2, :duration => 10, :volume => :loud, :content => "Hello there")).to eq(Prosody.new(doc, :pitch => :medium, :contour => "something", :range => '20Hz', :rate => 2, :duration => 10, :volume => :loud, :content => "Hello there"))
231
231
  end
232
232
 
233
233
  describe "when the content is different" do
234
234
  it "should not be equal" do
235
- Prosody.new(doc, :content => "Hello").should_not == Prosody.new(doc, :content => "Hello there")
235
+ expect(Prosody.new(doc, :content => "Hello")).not_to eq(Prosody.new(doc, :content => "Hello there"))
236
236
  end
237
237
  end
238
238
 
239
239
  describe "when the pitch is different" do
240
240
  it "should not be equal" do
241
- Prosody.new(doc, :pitch => :medium).should_not == Prosody.new(doc, :pitch => :high)
241
+ expect(Prosody.new(doc, :pitch => :medium)).not_to eq(Prosody.new(doc, :pitch => :high))
242
242
  end
243
243
  end
244
244
 
245
245
  describe "when the contour is different" do
246
246
  it "should not be equal" do
247
- Prosody.new(doc, :contour => 'foo').should_not == Prosody.new(doc, :contour => 'bar')
247
+ expect(Prosody.new(doc, :contour => 'foo')).not_to eq(Prosody.new(doc, :contour => 'bar'))
248
248
  end
249
249
  end
250
250
 
251
251
  describe "when the range is different" do
252
252
  it "should not be equal" do
253
- Prosody.new(doc, :range => '20Hz').should_not == Prosody.new(doc, :range => '30Hz')
253
+ expect(Prosody.new(doc, :range => '20Hz')).not_to eq(Prosody.new(doc, :range => '30Hz'))
254
254
  end
255
255
  end
256
256
 
257
257
  describe "when the rate is different" do
258
258
  it "should not be equal" do
259
- Prosody.new(doc, :rate => 2).should_not == Prosody.new(doc, :rate => 3)
259
+ expect(Prosody.new(doc, :rate => 2)).not_to eq(Prosody.new(doc, :rate => 3))
260
260
  end
261
261
  end
262
262
 
263
263
  describe "when the duration is different" do
264
264
  it "should not be equal" do
265
- Prosody.new(doc, :duration => 10).should_not == Prosody.new(doc, :duration => 20)
265
+ expect(Prosody.new(doc, :duration => 10)).not_to eq(Prosody.new(doc, :duration => 20))
266
266
  end
267
267
  end
268
268
 
269
269
  describe "when the volume is different" do
270
270
  it "should not be equal" do
271
- Prosody.new(doc, :volume => :loud).should_not == Prosody.new(doc, :volume => :soft)
271
+ expect(Prosody.new(doc, :volume => :loud)).not_to eq(Prosody.new(doc, :volume => :soft))
272
272
  end
273
273
  end
274
274
  end
275
275
 
276
276
  describe "<<" do
277
277
  it "should accept String" do
278
- lambda { subject << 'anything' }.should_not raise_error
278
+ expect { subject << 'anything' }.not_to raise_error
279
279
  end
280
280
 
281
281
  it "should accept Audio" do
282
- lambda { subject << Audio.new(doc) }.should_not raise_error
282
+ expect { subject << Audio.new(doc) }.not_to raise_error
283
283
  end
284
284
 
285
285
  it "should accept Break" do
286
- lambda { subject << Break.new(doc) }.should_not raise_error
286
+ expect { subject << Break.new(doc) }.not_to raise_error
287
287
  end
288
288
 
289
289
  it "should accept Emphasis" do
290
- lambda { subject << Emphasis.new(doc) }.should_not raise_error
290
+ expect { subject << Emphasis.new(doc) }.not_to raise_error
291
291
  end
292
292
 
293
293
  it "should accept Mark" do
294
- lambda { subject << Mark.new(doc) }.should_not raise_error
294
+ expect { subject << Mark.new(doc) }.not_to raise_error
295
295
  end
296
296
 
297
297
  it "should accept P" do
298
- lambda { subject << P.new(doc) }.should_not raise_error
298
+ expect { subject << P.new(doc) }.not_to raise_error
299
299
  end
300
300
 
301
301
  it "should accept Phoneme" do
302
- lambda { subject << Phoneme.new(doc) }.should_not raise_error
302
+ expect { subject << Phoneme.new(doc) }.not_to raise_error
303
303
  end
304
304
 
305
305
  it "should accept Prosody" do
306
- lambda { subject << Prosody.new(doc) }.should_not raise_error
306
+ expect { subject << Prosody.new(doc) }.not_to raise_error
307
307
  end
308
308
 
309
309
  it "should accept S" do
310
- lambda { subject << S.new(doc) }.should_not raise_error
310
+ expect { subject << S.new(doc) }.not_to raise_error
311
311
  end
312
312
 
313
313
  it "should accept SayAs" do
314
- lambda { subject << SayAs.new(doc, :interpret_as => :foo) }.should_not raise_error
314
+ expect { subject << SayAs.new(doc, :interpret_as => :foo) }.not_to raise_error
315
315
  end
316
316
 
317
317
  it "should accept Sub" do
318
- lambda { subject << Sub.new(doc) }.should_not raise_error
318
+ expect { subject << Sub.new(doc) }.not_to raise_error
319
319
  end
320
320
 
321
321
  it "should accept Voice" do
322
- lambda { subject << Voice.new(doc) }.should_not raise_error
322
+ expect { subject << Voice.new(doc) }.not_to raise_error
323
323
  end
324
324
 
325
325
  it "should raise InvalidChildError with non-acceptable objects" do
326
- lambda { subject << 1 }.should raise_error(InvalidChildError, "A Prosody can only accept String, Audio, Break, Emphasis, Mark, P, Phoneme, Prosody, SayAs, Sub, S, Voice as children")
326
+ expect { subject << 1 }.to raise_error(InvalidChildError, "A Prosody can only accept String, Audio, Break, Emphasis, Mark, P, Phoneme, Prosody, SayAs, Sub, S, Voice as children")
327
327
  end
328
328
  end
329
329
  end # Prosody