ruby_speech 2.1.2 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -2
  3. data/CHANGELOG.md +8 -0
  4. data/README.md +23 -0
  5. data/ext/ruby_speech/extconf.rb +3 -1
  6. data/ext/ruby_speech/ruby_speech.c +4 -1
  7. data/lib/ruby_speech.rb +6 -19
  8. data/lib/ruby_speech/generic_element.rb +141 -29
  9. data/lib/ruby_speech/grxml.rb +16 -22
  10. data/lib/ruby_speech/grxml/element.rb +6 -6
  11. data/lib/ruby_speech/grxml/grammar.rb +29 -12
  12. data/lib/ruby_speech/grxml/item.rb +13 -0
  13. data/lib/ruby_speech/grxml/matcher.rb +5 -1
  14. data/lib/ruby_speech/grxml/one_of.rb +4 -0
  15. data/lib/ruby_speech/grxml/rule.rb +10 -0
  16. data/lib/ruby_speech/grxml/token.rb +3 -0
  17. data/lib/ruby_speech/nlsml.rb +3 -9
  18. data/lib/ruby_speech/ssml.rb +20 -22
  19. data/lib/ruby_speech/ssml/audio.rb +17 -0
  20. data/lib/ruby_speech/ssml/desc.rb +4 -0
  21. data/lib/ruby_speech/ssml/element.rb +5 -3
  22. data/lib/ruby_speech/ssml/emphasis.rb +17 -0
  23. data/lib/ruby_speech/ssml/mark.rb +2 -0
  24. data/lib/ruby_speech/ssml/p.rb +21 -0
  25. data/lib/ruby_speech/ssml/phoneme.rb +2 -0
  26. data/lib/ruby_speech/ssml/prosody.rb +15 -0
  27. data/lib/ruby_speech/ssml/s.rb +20 -0
  28. data/lib/ruby_speech/ssml/say_as.rb +2 -0
  29. data/lib/ruby_speech/ssml/speak.rb +19 -1
  30. data/lib/ruby_speech/ssml/sub.rb +2 -0
  31. data/lib/ruby_speech/ssml/voice.rb +19 -0
  32. data/lib/ruby_speech/version.rb +1 -1
  33. data/ruby_speech.gemspec +2 -3
  34. data/spec/ruby_speech/grxml/grammar_spec.rb +35 -30
  35. data/spec/ruby_speech/grxml/item_spec.rb +8 -6
  36. data/spec/ruby_speech/grxml/one_of_spec.rb +7 -3
  37. data/spec/ruby_speech/grxml/rule_spec.rb +14 -12
  38. data/spec/ruby_speech/grxml/ruleref_spec.rb +5 -3
  39. data/spec/ruby_speech/grxml/tag_spec.rb +6 -2
  40. data/spec/ruby_speech/grxml/token_spec.rb +6 -2
  41. data/spec/ruby_speech/grxml_spec.rb +57 -69
  42. data/spec/ruby_speech/ssml/audio_spec.rb +20 -16
  43. data/spec/ruby_speech/ssml/break_spec.rb +14 -10
  44. data/spec/ruby_speech/ssml/desc_spec.rb +9 -5
  45. data/spec/ruby_speech/ssml/emphasis_spec.rb +17 -13
  46. data/spec/ruby_speech/ssml/mark_spec.rb +7 -3
  47. data/spec/ruby_speech/ssml/p_spec.rb +18 -14
  48. data/spec/ruby_speech/ssml/phoneme_spec.rb +10 -6
  49. data/spec/ruby_speech/ssml/prosody_spec.rb +29 -25
  50. data/spec/ruby_speech/ssml/s_spec.rb +17 -13
  51. data/spec/ruby_speech/ssml/say_as_spec.rb +11 -7
  52. data/spec/ruby_speech/ssml/speak_spec.rb +48 -32
  53. data/spec/ruby_speech/ssml/sub_spec.rb +9 -5
  54. data/spec/ruby_speech/ssml/voice_spec.rb +23 -19
  55. data/spec/ruby_speech/ssml_spec.rb +64 -63
  56. data/spec/spec_helper.rb +0 -3
  57. metadata +10 -31
  58. data/lib/ruby_speech/xml.rb +0 -11
@@ -3,10 +3,14 @@ require 'spec_helper'
3
3
  module RubySpeech
4
4
  module SSML
5
5
  describe Desc do
6
+ let(:doc) { Nokogiri::XML::Document.new }
7
+
8
+ subject { described_class.new doc }
9
+
6
10
  its(:name) { should == 'desc' }
7
11
 
8
12
  describe "setting options in initializers" do
9
- subject { Desc.new :language => 'foo' }
13
+ subject { Desc.new doc, :language => 'foo' }
10
14
 
11
15
  its(:language) { should == 'foo' }
12
16
  end
@@ -27,18 +31,18 @@ module RubySpeech
27
31
 
28
32
  describe "comparing objects" do
29
33
  it "should be equal if the content and language are the same" do
30
- Desc.new(:language => 'jp', :content => "Hello there").should == Desc.new(:language => 'jp', :content => "Hello there")
34
+ Desc.new(doc, :language => 'jp', :content => "Hello there").should == Desc.new(doc, :language => 'jp', :content => "Hello there")
31
35
  end
32
36
 
33
37
  describe "when the content is different" do
34
38
  it "should not be equal" do
35
- Desc.new(:content => "Hello").should_not == Desc.new(:content => "Hello there")
39
+ Desc.new(doc, :content => "Hello").should_not == Desc.new(doc, :content => "Hello there")
36
40
  end
37
41
  end
38
42
 
39
43
  describe "when the language is different" do
40
44
  it "should not be equal" do
41
- Desc.new(:language => 'jp').should_not == Desc.new(:language => 'en')
45
+ Desc.new(doc, :language => 'jp').should_not == Desc.new(doc, :language => 'en')
42
46
  end
43
47
  end
44
48
  end
@@ -49,7 +53,7 @@ module RubySpeech
49
53
  end
50
54
 
51
55
  it "should raise InvalidChildError with non-acceptable objects" do
52
- lambda { subject << Voice.new }.should raise_error(InvalidChildError, "A Desc can only accept Strings as children")
56
+ lambda { subject << Voice.new(doc) }.should raise_error(InvalidChildError, "A Desc can only accept Strings as children")
53
57
  end
54
58
  end
55
59
  end # Desc
@@ -3,10 +3,14 @@ require 'spec_helper'
3
3
  module RubySpeech
4
4
  module SSML
5
5
  describe Emphasis do
6
+ let(:doc) { Nokogiri::XML::Document.new }
7
+
8
+ subject { described_class.new doc }
9
+
6
10
  its(:name) { should == 'emphasis' }
7
11
 
8
12
  describe "setting options in initializers" do
9
- subject { Emphasis.new :level => :strong }
13
+ subject { Emphasis.new doc, :level => :strong }
10
14
 
11
15
  its(:level) { should == :strong }
12
16
  end
@@ -44,18 +48,18 @@ module RubySpeech
44
48
 
45
49
  describe "comparing objects" do
46
50
  it "should be equal if the content and level are the same" do
47
- Emphasis.new(:level => :strong, :content => "Hello there").should == Emphasis.new(:level => :strong, :content => "Hello there")
51
+ Emphasis.new(doc, :level => :strong, :content => "Hello there").should == Emphasis.new(doc, :level => :strong, :content => "Hello there")
48
52
  end
49
53
 
50
54
  describe "when the content is different" do
51
55
  it "should not be equal" do
52
- Emphasis.new(:content => "Hello").should_not == Emphasis.new(:content => "Hello there")
56
+ Emphasis.new(doc, :content => "Hello").should_not == Emphasis.new(doc, :content => "Hello there")
53
57
  end
54
58
  end
55
59
 
56
60
  describe "when the level is different" do
57
61
  it "should not be equal" do
58
- Emphasis.new(:level => :strong).should_not == Emphasis.new(:level => :reduced)
62
+ Emphasis.new(doc, :level => :strong).should_not == Emphasis.new(doc, :level => :reduced)
59
63
  end
60
64
  end
61
65
  end
@@ -66,39 +70,39 @@ module RubySpeech
66
70
  end
67
71
 
68
72
  it "should accept Audio" do
69
- lambda { subject << Audio.new }.should_not raise_error
73
+ lambda { subject << Audio.new(doc) }.should_not raise_error
70
74
  end
71
75
 
72
76
  it "should accept Break" do
73
- lambda { subject << Break.new }.should_not raise_error
77
+ lambda { subject << Break.new(doc) }.should_not raise_error
74
78
  end
75
79
 
76
80
  it "should accept Emphasis" do
77
- lambda { subject << Emphasis.new }.should_not raise_error
81
+ lambda { subject << Emphasis.new(doc) }.should_not raise_error
78
82
  end
79
83
 
80
84
  it "should accept Mark" do
81
- lambda { subject << Mark.new }.should_not raise_error
85
+ lambda { subject << Mark.new(doc) }.should_not raise_error
82
86
  end
83
87
 
84
88
  it "should accept Phoneme" do
85
- lambda { subject << Phoneme.new }.should_not raise_error
89
+ lambda { subject << Phoneme.new(doc) }.should_not raise_error
86
90
  end
87
91
 
88
92
  it "should accept Prosody" do
89
- lambda { subject << Prosody.new }.should_not raise_error
93
+ lambda { subject << Prosody.new(doc) }.should_not raise_error
90
94
  end
91
95
 
92
96
  it "should accept SayAs" do
93
- lambda { subject << SayAs.new(:interpret_as => :foo) }.should_not raise_error
97
+ lambda { subject << SayAs.new(doc, :interpret_as => :foo) }.should_not raise_error
94
98
  end
95
99
 
96
100
  it "should accept Sub" do
97
- lambda { subject << Sub.new }.should_not raise_error
101
+ lambda { subject << Sub.new(doc) }.should_not raise_error
98
102
  end
99
103
 
100
104
  it "should accept Voice" do
101
- lambda { subject << Voice.new }.should_not raise_error
105
+ lambda { subject << Voice.new(doc) }.should_not raise_error
102
106
  end
103
107
 
104
108
  it "should raise InvalidChildError with non-acceptable objects" do
@@ -3,10 +3,14 @@ require 'spec_helper'
3
3
  module RubySpeech
4
4
  module SSML
5
5
  describe Mark do
6
+ let(:doc) { Nokogiri::XML::Document.new }
7
+
8
+ subject { described_class.new doc }
9
+
6
10
  its(:node_name) { should == 'mark' }
7
11
 
8
12
  describe "setting options in initializers" do
9
- subject { Mark.new :name => 'foo' }
13
+ subject { Mark.new doc, :name => 'foo' }
10
14
 
11
15
  its(:name) { should == 'foo' }
12
16
  end
@@ -39,12 +43,12 @@ module RubySpeech
39
43
 
40
44
  describe "comparing objects" do
41
45
  it "should be equal if the name is the same" do
42
- Mark.new(:name => "foo").should == Mark.new(:name => "foo")
46
+ Mark.new(doc, :name => "foo").should == Mark.new(doc, :name => "foo")
43
47
  end
44
48
 
45
49
  describe "when the name is different" do
46
50
  it "should not be equal" do
47
- Mark.new(:name => "foo").should_not == Mark.new(:name => "bar")
51
+ Mark.new(doc, :name => "foo").should_not == Mark.new(doc, :name => "bar")
48
52
  end
49
53
  end
50
54
  end
@@ -3,10 +3,14 @@ require 'spec_helper'
3
3
  module RubySpeech
4
4
  module SSML
5
5
  describe P do
6
+ let(:doc) { Nokogiri::XML::Document.new }
7
+
8
+ subject { described_class.new doc }
9
+
6
10
  its(:name) { should == 'p' }
7
11
 
8
12
  describe "setting options in initializers" do
9
- subject { P.new :language => 'jp' }
13
+ subject { P.new doc, :language => 'jp' }
10
14
 
11
15
  its(:language) { should == 'jp' }
12
16
  end
@@ -26,18 +30,18 @@ module RubySpeech
26
30
 
27
31
  describe "comparing objects" do
28
32
  it "should be equal if the content and language are the same" do
29
- P.new(:language => 'jp', :content => "Hello there").should == P.new(:language => 'jp', :content => "Hello there")
33
+ P.new(doc, :language => 'jp', :content => "Hello there").should == P.new(doc, :language => 'jp', :content => "Hello there")
30
34
  end
31
35
 
32
36
  describe "when the content is different" do
33
37
  it "should not be equal" do
34
- P.new(:content => "Hello").should_not == P.new(:content => "Hello there")
38
+ P.new(doc, :content => "Hello").should_not == P.new(doc, :content => "Hello there")
35
39
  end
36
40
  end
37
41
 
38
42
  describe "when the language is different" do
39
43
  it "should not be equal" do
40
- P.new(:language => 'jp').should_not == P.new(:language => 'en')
44
+ P.new(doc, :language => 'jp').should_not == P.new(doc, :language => 'en')
41
45
  end
42
46
  end
43
47
  end
@@ -48,43 +52,43 @@ module RubySpeech
48
52
  end
49
53
 
50
54
  it "should accept Audio" do
51
- lambda { subject << Audio.new }.should_not raise_error
55
+ lambda { subject << Audio.new(doc) }.should_not raise_error
52
56
  end
53
57
 
54
58
  it "should accept Break" do
55
- lambda { subject << Break.new }.should_not raise_error
59
+ lambda { subject << Break.new(doc) }.should_not raise_error
56
60
  end
57
61
 
58
62
  it "should accept Emphasis" do
59
- lambda { subject << Emphasis.new }.should_not raise_error
63
+ lambda { subject << Emphasis.new(doc) }.should_not raise_error
60
64
  end
61
65
 
62
66
  it "should accept Mark" do
63
- lambda { subject << Mark.new }.should_not raise_error
67
+ lambda { subject << Mark.new(doc) }.should_not raise_error
64
68
  end
65
69
 
66
70
  it "should accept Phoneme" do
67
- lambda { subject << Phoneme.new }.should_not raise_error
71
+ lambda { subject << Phoneme.new(doc) }.should_not raise_error
68
72
  end
69
73
 
70
74
  it "should accept Prosody" do
71
- lambda { subject << Prosody.new }.should_not raise_error
75
+ lambda { subject << Prosody.new(doc) }.should_not raise_error
72
76
  end
73
77
 
74
78
  it "should accept SayAs" do
75
- lambda { subject << SayAs.new(:interpret_as => :foo) }.should_not raise_error
79
+ lambda { subject << SayAs.new(doc, :interpret_as => :foo) }.should_not raise_error
76
80
  end
77
81
 
78
82
  it "should accept Sub" do
79
- lambda { subject << Sub.new }.should_not raise_error
83
+ lambda { subject << Sub.new(doc) }.should_not raise_error
80
84
  end
81
85
 
82
86
  it "should accept S" do
83
- lambda { subject << S.new }.should_not raise_error
87
+ lambda { subject << S.new(doc) }.should_not raise_error
84
88
  end
85
89
 
86
90
  it "should accept Voice" do
87
- lambda { subject << Voice.new }.should_not raise_error
91
+ lambda { subject << Voice.new(doc) }.should_not raise_error
88
92
  end
89
93
 
90
94
  it "should raise InvalidChildError with non-acceptable objects" do
@@ -3,10 +3,14 @@ require 'spec_helper'
3
3
  module RubySpeech
4
4
  module SSML
5
5
  describe Phoneme do
6
+ let(:doc) { Nokogiri::XML::Document.new }
7
+
8
+ subject { described_class.new doc }
9
+
6
10
  its(:name) { should == 'phoneme' }
7
11
 
8
12
  describe "setting options in initializers" do
9
- subject { Phoneme.new :alphabet => 'foo', :ph => 'bar' }
13
+ subject { Phoneme.new doc, :alphabet => 'foo', :ph => 'bar' }
10
14
 
11
15
  its(:alphabet) { should == 'foo' }
12
16
  its(:ph) { should == 'bar' }
@@ -29,24 +33,24 @@ module RubySpeech
29
33
 
30
34
  describe "comparing objects" do
31
35
  it "should be equal if the content, ph and alphabet are the same" do
32
- Phoneme.new(:alphabet => 'jp', :ph => 'foo', :content => "Hello there").should == Phoneme.new(:alphabet => 'jp', :ph => 'foo', :content => "Hello there")
36
+ Phoneme.new(doc, :alphabet => 'jp', :ph => 'foo', :content => "Hello there").should == Phoneme.new(doc, :alphabet => 'jp', :ph => 'foo', :content => "Hello there")
33
37
  end
34
38
 
35
39
  describe "when the content is different" do
36
40
  it "should not be equal" do
37
- Phoneme.new(:content => "Hello").should_not == Phoneme.new(:content => "Hello there")
41
+ Phoneme.new(doc, :content => "Hello").should_not == Phoneme.new(doc, :content => "Hello there")
38
42
  end
39
43
  end
40
44
 
41
45
  describe "when the ph is different" do
42
46
  it "should not be equal" do
43
- Phoneme.new(:ph => 'jp').should_not == Phoneme.new(:ph => 'en')
47
+ Phoneme.new(doc, :ph => 'jp').should_not == Phoneme.new(doc, :ph => 'en')
44
48
  end
45
49
  end
46
50
 
47
51
  describe "when the alphabet is different" do
48
52
  it "should not be equal" do
49
- Phoneme.new(:alphabet => 'jp').should_not == Phoneme.new(:alphabet => 'en')
53
+ Phoneme.new(doc, :alphabet => 'jp').should_not == Phoneme.new(doc, :alphabet => 'en')
50
54
  end
51
55
  end
52
56
  end
@@ -57,7 +61,7 @@ module RubySpeech
57
61
  end
58
62
 
59
63
  it "should raise InvalidChildError with non-acceptable objects" do
60
- lambda { subject << Voice.new }.should raise_error(InvalidChildError, "A Phoneme can only accept Strings as children")
64
+ lambda { subject << Voice.new(doc) }.should raise_error(InvalidChildError, "A Phoneme can only accept Strings as children")
61
65
  end
62
66
  end
63
67
  end # Desc
@@ -3,16 +3,20 @@ require 'spec_helper'
3
3
  module RubySpeech
4
4
  module SSML
5
5
  describe Prosody do
6
+ let(:doc) { Nokogiri::XML::Document.new }
7
+
8
+ subject { described_class.new doc }
9
+
6
10
  its(:name) { should == 'prosody' }
7
11
 
8
12
  describe "setting options in initializers" do
9
- subject { Prosody.new :pitch => :medium, :contour => "something", :range => '20Hz', :rate => 2, :duration => 10.seconds, :volume => :loud }
13
+ subject { Prosody.new doc, :pitch => :medium, :contour => "something", :range => '20Hz', :rate => 2, :duration => 10, :volume => :loud }
10
14
 
11
15
  its(:pitch) { should == :medium }
12
16
  its(:contour) { should == 'something' }
13
17
  its(:range) { should == '20Hz' }
14
18
  its(:rate) { should == 2 }
15
- its(:duration) { should == 10.seconds }
19
+ its(:duration) { should == 10 }
16
20
  its(:volume) { should == :loud }
17
21
  end
18
22
 
@@ -31,7 +35,7 @@ module RubySpeech
31
35
  its(:contour) { should == 'something' }
32
36
  its(:range) { should == '20Hz' }
33
37
  its(:rate) { should == 2 }
34
- its(:duration) { should == 10.seconds }
38
+ its(:duration) { should == 10 }
35
39
  its(:volume) { should == :loud }
36
40
  end
37
41
 
@@ -150,14 +154,14 @@ module RubySpeech
150
154
 
151
155
  describe "#duration" do
152
156
  context "with a valid value" do
153
- before { subject.duration = 3.seconds }
157
+ before { subject.duration = 3 }
154
158
 
155
- its(:duration) { should == 3.seconds }
159
+ its(:duration) { should == 3 }
156
160
  end
157
161
 
158
162
  context "with a negative value" do
159
163
  it do
160
- lambda { subject.duration = -3.seconds }.should raise_error(ArgumentError, "You must specify a valid duration (positive float value in seconds)")
164
+ lambda { subject.duration = -3 }.should raise_error(ArgumentError, "You must specify a valid duration (positive float value in seconds)")
161
165
  end
162
166
  end
163
167
 
@@ -205,48 +209,48 @@ module RubySpeech
205
209
 
206
210
  describe "comparing objects" do
207
211
  it "should be equal if the content, strength and base uri are the same" do
208
- Prosody.new(:pitch => :medium, :contour => "something", :range => '20Hz', :rate => 2, :duration => 10.seconds, :volume => :loud, :content => "Hello there").should == Prosody.new(:pitch => :medium, :contour => "something", :range => '20Hz', :rate => 2, :duration => 10.seconds, :volume => :loud, :content => "Hello there")
212
+ 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")
209
213
  end
210
214
 
211
215
  describe "when the content is different" do
212
216
  it "should not be equal" do
213
- Prosody.new(:content => "Hello").should_not == Prosody.new(:content => "Hello there")
217
+ Prosody.new(doc, :content => "Hello").should_not == Prosody.new(doc, :content => "Hello there")
214
218
  end
215
219
  end
216
220
 
217
221
  describe "when the pitch is different" do
218
222
  it "should not be equal" do
219
- Prosody.new(:pitch => :medium).should_not == Prosody.new(:pitch => :high)
223
+ Prosody.new(doc, :pitch => :medium).should_not == Prosody.new(doc, :pitch => :high)
220
224
  end
221
225
  end
222
226
 
223
227
  describe "when the contour is different" do
224
228
  it "should not be equal" do
225
- Prosody.new(:contour => 'foo').should_not == Prosody.new(:contour => 'bar')
229
+ Prosody.new(doc, :contour => 'foo').should_not == Prosody.new(doc, :contour => 'bar')
226
230
  end
227
231
  end
228
232
 
229
233
  describe "when the range is different" do
230
234
  it "should not be equal" do
231
- Prosody.new(:range => '20Hz').should_not == Prosody.new(:range => '30Hz')
235
+ Prosody.new(doc, :range => '20Hz').should_not == Prosody.new(doc, :range => '30Hz')
232
236
  end
233
237
  end
234
238
 
235
239
  describe "when the rate is different" do
236
240
  it "should not be equal" do
237
- Prosody.new(:rate => 2).should_not == Prosody.new(:rate => 3)
241
+ Prosody.new(doc, :rate => 2).should_not == Prosody.new(doc, :rate => 3)
238
242
  end
239
243
  end
240
244
 
241
245
  describe "when the duration is different" do
242
246
  it "should not be equal" do
243
- Prosody.new(:duration => 10.seconds).should_not == Prosody.new(:duration => 20.seconds)
247
+ Prosody.new(doc, :duration => 10).should_not == Prosody.new(doc, :duration => 20)
244
248
  end
245
249
  end
246
250
 
247
251
  describe "when the volume is different" do
248
252
  it "should not be equal" do
249
- Prosody.new(:volume => :loud).should_not == Prosody.new(:volume => :soft)
253
+ Prosody.new(doc, :volume => :loud).should_not == Prosody.new(doc, :volume => :soft)
250
254
  end
251
255
  end
252
256
  end
@@ -257,47 +261,47 @@ module RubySpeech
257
261
  end
258
262
 
259
263
  it "should accept Audio" do
260
- lambda { subject << Audio.new }.should_not raise_error
264
+ lambda { subject << Audio.new(doc) }.should_not raise_error
261
265
  end
262
266
 
263
267
  it "should accept Break" do
264
- lambda { subject << Break.new }.should_not raise_error
268
+ lambda { subject << Break.new(doc) }.should_not raise_error
265
269
  end
266
270
 
267
271
  it "should accept Emphasis" do
268
- lambda { subject << Emphasis.new }.should_not raise_error
272
+ lambda { subject << Emphasis.new(doc) }.should_not raise_error
269
273
  end
270
274
 
271
275
  it "should accept Mark" do
272
- lambda { subject << Mark.new }.should_not raise_error
276
+ lambda { subject << Mark.new(doc) }.should_not raise_error
273
277
  end
274
278
 
275
279
  it "should accept P" do
276
- lambda { subject << P.new }.should_not raise_error
280
+ lambda { subject << P.new(doc) }.should_not raise_error
277
281
  end
278
282
 
279
283
  it "should accept Phoneme" do
280
- lambda { subject << Phoneme.new }.should_not raise_error
284
+ lambda { subject << Phoneme.new(doc) }.should_not raise_error
281
285
  end
282
286
 
283
287
  it "should accept Prosody" do
284
- lambda { subject << Prosody.new }.should_not raise_error
288
+ lambda { subject << Prosody.new(doc) }.should_not raise_error
285
289
  end
286
290
 
287
291
  it "should accept S" do
288
- lambda { subject << S.new }.should_not raise_error
292
+ lambda { subject << S.new(doc) }.should_not raise_error
289
293
  end
290
294
 
291
295
  it "should accept SayAs" do
292
- lambda { subject << SayAs.new(:interpret_as => :foo) }.should_not raise_error
296
+ lambda { subject << SayAs.new(doc, :interpret_as => :foo) }.should_not raise_error
293
297
  end
294
298
 
295
299
  it "should accept Sub" do
296
- lambda { subject << Sub.new }.should_not raise_error
300
+ lambda { subject << Sub.new(doc) }.should_not raise_error
297
301
  end
298
302
 
299
303
  it "should accept Voice" do
300
- lambda { subject << Voice.new }.should_not raise_error
304
+ lambda { subject << Voice.new(doc) }.should_not raise_error
301
305
  end
302
306
 
303
307
  it "should raise InvalidChildError with non-acceptable objects" do