rspec-speak 1.0

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: e1b3e95248daf2c033bc9ce976a21348838f8c80
4
+ data.tar.gz: 7d31efd201e9d7efcceafd194396f170288f227e
5
+ SHA512:
6
+ metadata.gz: 7baf2ee931e1fe13416e2d2b47da8761451011d3833e34769149193392369c5c3988292a1f870e70929c6cb4203f40a531ea582b0eb8d8b772e94a7cc9bc7a19
7
+ data.tar.gz: ae53f82b185b3a1aa60ddc8a5fa0679f3799fcd340e86ae397bfdf2e9fe983fe173bc0c89149f9bbd2bd3681015546392cfd7ad7e703737740af295b1d0e0cb6
data/.gitignore ADDED
@@ -0,0 +1,14 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in rspec-speak.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Nathan Clark
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,14 @@
1
+ # RSpec Speak
2
+
3
+ The most useless RSpec plugin ever created. Uses OSX's built-in `say` command
4
+ to speak the name and result of each test.
5
+
6
+ ## Usage
7
+
8
+ ```
9
+ require 'speak'
10
+
11
+ RSpec.configure do |config|
12
+ config.include Speak
13
+ end
14
+ ```
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
data/lib/speak.rb ADDED
@@ -0,0 +1,49 @@
1
+ # Reads test descriptions and results out loud.
2
+ module Speak
3
+ # Speaks the name of the test.
4
+ def speak_name(test)
5
+ say(test_description(test))
6
+ end
7
+
8
+ # Speaks the test result.
9
+ def speak_result
10
+ if example.pending?
11
+ say("is pending")
12
+ elsif example.exception
13
+ say("failed")
14
+ else
15
+ say("passed")
16
+ end
17
+ end
18
+
19
+ private
20
+
21
+ # Speaks the message.
22
+ def say(message)
23
+ system("say", message)
24
+ end
25
+
26
+ # Hooks this into RSpec.
27
+ def self.included(config)
28
+ config.before(:each) do |test|
29
+ speak_name(test)
30
+ end
31
+
32
+ config.after(:each) do
33
+ speak_result
34
+ end
35
+ end
36
+
37
+ # Gets the full description of the test.
38
+ def test_description(test)
39
+ meta = test.example.metadata
40
+ path = []
41
+ while meta && meta[:description_args]
42
+ path << meta[:description_args].join
43
+ meta = meta[:example_group]
44
+ end
45
+
46
+ description = path.reverse.join(" ")
47
+ description.gsub(/\s+/, " ").gsub(/[^\w ]+/, "")
48
+ end
49
+ end
@@ -0,0 +1,22 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "rspec-speak"
7
+ spec.version = "1.0"
8
+ spec.authors = ["Nathan Clark"]
9
+ spec.email = ["Nathan.Clark@tokenshift.com"]
10
+ spec.summary = %q{Listen to your tests.}
11
+ spec.description = %q{No, really. Listen.}
12
+ spec.homepage = "https://github.com/tokenshift/rspec-speak"
13
+ spec.license = "MIT"
14
+
15
+ spec.files = `git ls-files -z`.split("\x0")
16
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
+ spec.require_paths = ["lib"]
19
+
20
+ spec.add_development_dependency "bundler", "~> 1.7"
21
+ spec.add_development_dependency "rake", "~> 10.0"
22
+ end
metadata ADDED
@@ -0,0 +1,79 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rspec-speak
3
+ version: !ruby/object:Gem::Version
4
+ version: '1.0'
5
+ platform: ruby
6
+ authors:
7
+ - Nathan Clark
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-09-22 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.7'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.7'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ description: No, really. Listen.
42
+ email:
43
+ - Nathan.Clark@tokenshift.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - ".gitignore"
49
+ - Gemfile
50
+ - LICENSE.txt
51
+ - README.md
52
+ - Rakefile
53
+ - lib/speak.rb
54
+ - rspec-speak.gemspec
55
+ homepage: https://github.com/tokenshift/rspec-speak
56
+ licenses:
57
+ - MIT
58
+ metadata: {}
59
+ post_install_message:
60
+ rdoc_options: []
61
+ require_paths:
62
+ - lib
63
+ required_ruby_version: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ required_rubygems_version: !ruby/object:Gem::Requirement
69
+ requirements:
70
+ - - ">="
71
+ - !ruby/object:Gem::Version
72
+ version: '0'
73
+ requirements: []
74
+ rubyforge_project:
75
+ rubygems_version: 2.4.1
76
+ signing_key:
77
+ specification_version: 4
78
+ summary: Listen to your tests.
79
+ test_files: []