bratta-mactts 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +4 -0
- data/Rakefile +1 -1
- data/lib/mactts.rb +3 -3
- data/mactts.gemspec +1 -1
- data/spec/mactts_spec.rb +5 -5
- metadata +1 -1
data/CHANGELOG
CHANGED
data/Rakefile
CHANGED
data/lib/mactts.rb
CHANGED
@@ -41,7 +41,7 @@ module Mac
|
|
41
41
|
# Mac::TTS.say('This is my text!', :alex)
|
42
42
|
def self.say(text, voice = :fred)
|
43
43
|
mactts = TTS.new(:voice => voice)
|
44
|
-
mactts.
|
44
|
+
mactts.say(text)
|
45
45
|
end
|
46
46
|
|
47
47
|
# Use TTS to speak your text, with the voice specified
|
@@ -49,8 +49,8 @@ module Mac
|
|
49
49
|
#
|
50
50
|
# Usage:
|
51
51
|
# mactts = Mac::TTS.new
|
52
|
-
# mactts.
|
53
|
-
def
|
52
|
+
# mactts.say('This is my text!')
|
53
|
+
def say(text)
|
54
54
|
check_for_command
|
55
55
|
validate_voice
|
56
56
|
perform_say(text, @voice)
|
data/mactts.gemspec
CHANGED
data/spec/mactts_spec.rb
CHANGED
@@ -30,27 +30,27 @@ describe Mac::TTS, "When using an instantiated object" do
|
|
30
30
|
end
|
31
31
|
|
32
32
|
it "should say default text" do
|
33
|
-
@mactts.
|
33
|
+
@mactts.say(@sample_text).should == true
|
34
34
|
end
|
35
35
|
|
36
36
|
it "should say default text as alex" do
|
37
37
|
@mactts.voice = :alex
|
38
|
-
@mactts.
|
38
|
+
@mactts.say(@sample_text).should == true
|
39
39
|
end
|
40
40
|
|
41
41
|
it "should raise an error when an invalid voice is specified" do
|
42
42
|
@mactts.voice = :beef
|
43
|
-
lambda{ @mactts.
|
43
|
+
lambda{ @mactts.say(@sample_text) }.should raise_error(Mac::TTS::InvalidVoiceException)
|
44
44
|
end
|
45
45
|
|
46
46
|
it "should raise an error when an invalid command is specified" do
|
47
47
|
@mactts.voice = :fred
|
48
48
|
@mactts.say_command = '/should/not/exist'
|
49
|
-
lambda{ @mactts.
|
49
|
+
lambda{ @mactts.say(@sample_text) }.should raise_error(Mac::TTS::SayCommandNotFoundException)
|
50
50
|
end
|
51
51
|
|
52
52
|
it "should return false if a valid command that is not say is specified" do
|
53
53
|
@mactts.say_command = '/usr/bin/env'
|
54
|
-
@mactts.
|
54
|
+
@mactts.say(@sample_text).should == false
|
55
55
|
end
|
56
56
|
end
|