ruby_speech 2.4.0-java → 3.0.0-java
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.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +11 -23
- data/CHANGELOG.md +4 -0
- data/README.md +2 -2
- data/Rakefile +2 -0
- data/lib/ruby_speech/version.rb +1 -1
- data/ruby_speech.gemspec +3 -3
- data/spec/ruby_speech/grxml/builtins_spec.rb +72 -72
- data/spec/ruby_speech/grxml/grammar_spec.rb +37 -37
- data/spec/ruby_speech/grxml/item_spec.rb +33 -33
- data/spec/ruby_speech/grxml/match_spec.rb +1 -1
- data/spec/ruby_speech/grxml/matcher_spec.rb +62 -62
- data/spec/ruby_speech/grxml/max_match_spec.rb +2 -2
- data/spec/ruby_speech/grxml/no_match_spec.rb +2 -2
- data/spec/ruby_speech/grxml/one_of_spec.rb +6 -6
- data/spec/ruby_speech/grxml/potential_match_spec.rb +2 -2
- data/spec/ruby_speech/grxml/rule_spec.rb +17 -17
- data/spec/ruby_speech/grxml/ruleref_spec.rb +10 -10
- data/spec/ruby_speech/grxml/tag_spec.rb +5 -5
- data/spec/ruby_speech/grxml/token_spec.rb +7 -7
- data/spec/ruby_speech/grxml_spec.rb +24 -24
- data/spec/ruby_speech/nlsml_spec.rb +11 -11
- data/spec/ruby_speech/ssml/audio_spec.rb +19 -19
- data/spec/ruby_speech/ssml/break_spec.rb +16 -16
- data/spec/ruby_speech/ssml/desc_spec.rb +7 -7
- data/spec/ruby_speech/ssml/emphasis_spec.rb +21 -21
- data/spec/ruby_speech/ssml/mark_spec.rb +5 -5
- data/spec/ruby_speech/ssml/p_spec.rb +17 -17
- data/spec/ruby_speech/ssml/phoneme_spec.rb +8 -8
- data/spec/ruby_speech/ssml/prosody_spec.rb +61 -61
- data/spec/ruby_speech/ssml/s_spec.rb +16 -16
- data/spec/ruby_speech/ssml/say_as_spec.rb +9 -9
- data/spec/ruby_speech/ssml/speak_spec.rb +29 -29
- data/spec/ruby_speech/ssml/sub_spec.rb +7 -7
- data/spec/ruby_speech/ssml/voice_spec.rb +31 -31
- data/spec/ruby_speech/ssml_spec.rb +20 -20
- data/spec/ruby_speech_spec.rb +3 -3
- data/spec/spec_helper.rb +0 -1
- data/spec/support/grammar_matchers.rb +6 -6
- data/spec/support/match_examples.rb +5 -5
- data/spec/support/matchers.rb +1 -1
- 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).
|
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 {
|
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
|
-
|
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").
|
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").
|
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).
|
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 {
|
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").
|
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").
|
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').
|
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
|
-
|
51
|
+
expect { subject << 'anything' }.not_to raise_error
|
52
52
|
end
|
53
53
|
|
54
54
|
it "should accept Audio" do
|
55
|
-
|
55
|
+
expect { subject << Audio.new(doc) }.not_to raise_error
|
56
56
|
end
|
57
57
|
|
58
58
|
it "should accept Break" do
|
59
|
-
|
59
|
+
expect { subject << Break.new(doc) }.not_to raise_error
|
60
60
|
end
|
61
61
|
|
62
62
|
it "should accept Emphasis" do
|
63
|
-
|
63
|
+
expect { subject << Emphasis.new(doc) }.not_to raise_error
|
64
64
|
end
|
65
65
|
|
66
66
|
it "should accept Mark" do
|
67
|
-
|
67
|
+
expect { subject << Mark.new(doc) }.not_to raise_error
|
68
68
|
end
|
69
69
|
|
70
70
|
it "should accept Phoneme" do
|
71
|
-
|
71
|
+
expect { subject << Phoneme.new(doc) }.not_to raise_error
|
72
72
|
end
|
73
73
|
|
74
74
|
it "should accept Prosody" do
|
75
|
-
|
75
|
+
expect { subject << Prosody.new(doc) }.not_to raise_error
|
76
76
|
end
|
77
77
|
|
78
78
|
it "should accept SayAs" do
|
79
|
-
|
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
|
-
|
83
|
+
expect { subject << Sub.new(doc) }.not_to raise_error
|
84
84
|
end
|
85
85
|
|
86
86
|
it "should accept S" do
|
87
|
-
|
87
|
+
expect { subject << S.new(doc) }.not_to raise_error
|
88
88
|
end
|
89
89
|
|
90
90
|
it "should accept Voice" do
|
91
|
-
|
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
|
-
|
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).
|
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 {
|
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").
|
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").
|
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').
|
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').
|
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
|
-
|
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
|
-
|
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).
|
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 {
|
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
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
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
|
-
|
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
|
-
|
223
|
-
|
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").
|
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").
|
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).
|
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').
|
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').
|
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).
|
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).
|
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).
|
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
|
-
|
278
|
+
expect { subject << 'anything' }.not_to raise_error
|
279
279
|
end
|
280
280
|
|
281
281
|
it "should accept Audio" do
|
282
|
-
|
282
|
+
expect { subject << Audio.new(doc) }.not_to raise_error
|
283
283
|
end
|
284
284
|
|
285
285
|
it "should accept Break" do
|
286
|
-
|
286
|
+
expect { subject << Break.new(doc) }.not_to raise_error
|
287
287
|
end
|
288
288
|
|
289
289
|
it "should accept Emphasis" do
|
290
|
-
|
290
|
+
expect { subject << Emphasis.new(doc) }.not_to raise_error
|
291
291
|
end
|
292
292
|
|
293
293
|
it "should accept Mark" do
|
294
|
-
|
294
|
+
expect { subject << Mark.new(doc) }.not_to raise_error
|
295
295
|
end
|
296
296
|
|
297
297
|
it "should accept P" do
|
298
|
-
|
298
|
+
expect { subject << P.new(doc) }.not_to raise_error
|
299
299
|
end
|
300
300
|
|
301
301
|
it "should accept Phoneme" do
|
302
|
-
|
302
|
+
expect { subject << Phoneme.new(doc) }.not_to raise_error
|
303
303
|
end
|
304
304
|
|
305
305
|
it "should accept Prosody" do
|
306
|
-
|
306
|
+
expect { subject << Prosody.new(doc) }.not_to raise_error
|
307
307
|
end
|
308
308
|
|
309
309
|
it "should accept S" do
|
310
|
-
|
310
|
+
expect { subject << S.new(doc) }.not_to raise_error
|
311
311
|
end
|
312
312
|
|
313
313
|
it "should accept SayAs" do
|
314
|
-
|
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
|
-
|
318
|
+
expect { subject << Sub.new(doc) }.not_to raise_error
|
319
319
|
end
|
320
320
|
|
321
321
|
it "should accept Voice" do
|
322
|
-
|
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
|
-
|
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
|