starting_blocks-rspec 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +40 -0
- data/lib/result_builder.rb +33 -0
- data/lib/rspec_contract.rb +17 -0
- data/lib/starting_blocks-rspec.rb +3 -0
- metadata +104 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: fc68ed9b056feb0b9ebf706bcdacfed325e45a6c
|
4
|
+
data.tar.gz: b1f79acdee801f7fb8a36a9dbd2758d8294aab7e
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 045a6ce8588454d6c0d5f578207a2032527fac9f49fe96f6e2b485e5d7532a6d1db3d6bf38d392f118323439a4a14fc52b7ce105499d02a034e2b6b80c311a57
|
7
|
+
data.tar.gz: 015acd4b996d73b8b5dfd9212c8a2f268c347b20dcb654264c968f36a27ebdefc6adec1add1eac51bab5fa04391ce2a3f5ab0bb571f01b43185799b9c4e4e451
|
data/README.md
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
# StartingBlocks::Rspec
|
2
|
+
|
3
|
+
Use [starting blocks](http://www.github.com/darrencauthon/starting_blocks) to run your Rspec tests.
|
4
|
+
|
5
|
+
As you edit files in your ruby app, starting_blocks will run the tests automatically. You can use this plugin in addition to the other starting_block plugins, like adding a red/green/yellow light with [blinky](http://www.github.com/darrencauthon/starting_blocks-blinky) or notifications with [Growl](http://www.github.com/darrencauthon/starting_blocks-growl).
|
6
|
+
|
7
|
+
## Usage
|
8
|
+
|
9
|
+
Include "--rspec" when running starting blocks.
|
10
|
+
|
11
|
+
```
|
12
|
+
sb --rspec
|
13
|
+
```
|
14
|
+
|
15
|
+
Now when you update a test file or you edit a file with a similar name to a test file, the tests will be run.
|
16
|
+
|
17
|
+
*Note: When I say "tests will be run," I mean starting_blocks will run "rspec" for you.*
|
18
|
+
|
19
|
+
## Installation
|
20
|
+
|
21
|
+
Add this line to your application's Gemfile:
|
22
|
+
|
23
|
+
gem 'starting_blocks-rspec'
|
24
|
+
|
25
|
+
And then execute:
|
26
|
+
|
27
|
+
$ bundle
|
28
|
+
|
29
|
+
Or install it yourself as:
|
30
|
+
|
31
|
+
$ gem install starting_blocks-rspec
|
32
|
+
|
33
|
+
|
34
|
+
## Contributing
|
35
|
+
|
36
|
+
1. Fork it
|
37
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
38
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
39
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
40
|
+
5. Create new Pull Request
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module StartingBlocks
|
2
|
+
|
3
|
+
class ResultBuilder
|
4
|
+
|
5
|
+
def build_from run_result
|
6
|
+
@run_result = run_result
|
7
|
+
{
|
8
|
+
color: color,
|
9
|
+
text: @run_result[:text],
|
10
|
+
exit_code: @run_result[:exit_code],
|
11
|
+
success: @run_result[:success]
|
12
|
+
}
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
def color
|
18
|
+
return :red unless successful_exit_code?
|
19
|
+
return :red unless success?
|
20
|
+
:green
|
21
|
+
end
|
22
|
+
|
23
|
+
def successful_exit_code?
|
24
|
+
@run_result[:exit_code] == 0
|
25
|
+
end
|
26
|
+
|
27
|
+
def success?
|
28
|
+
@run_result[:success]
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
@@ -0,0 +1,17 @@
|
|
1
|
+
class RspecContract < StartingBlocks::Contract
|
2
|
+
|
3
|
+
def file_clues
|
4
|
+
["test", "spec"]
|
5
|
+
end
|
6
|
+
|
7
|
+
def extensions
|
8
|
+
['.rb']
|
9
|
+
end
|
10
|
+
|
11
|
+
def execute_these_files files
|
12
|
+
requires = files.map { |x| "require '#{x}'" }.join("\n")
|
13
|
+
command = "rspec #{files.join(" ")}"
|
14
|
+
StartingBlocks::Bash.run command
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
metadata
ADDED
@@ -0,0 +1,104 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: starting_blocks-rspec
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Ross Fuhrman
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-02-11 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.3'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: mocha
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: starting_blocks
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
description: Run your rspec tests automatically.
|
70
|
+
email:
|
71
|
+
- r.oss.fuhrman@gmail.com
|
72
|
+
executables: []
|
73
|
+
extensions: []
|
74
|
+
extra_rdoc_files: []
|
75
|
+
files:
|
76
|
+
- README.md
|
77
|
+
- lib/result_builder.rb
|
78
|
+
- lib/rspec_contract.rb
|
79
|
+
- lib/starting_blocks-rspec.rb
|
80
|
+
homepage: http://www.github.com/rossfuhrman/starting_blocks-rspec
|
81
|
+
licenses:
|
82
|
+
- MIT
|
83
|
+
metadata: {}
|
84
|
+
post_install_message:
|
85
|
+
rdoc_options: []
|
86
|
+
require_paths:
|
87
|
+
- lib
|
88
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
89
|
+
requirements:
|
90
|
+
- - '>='
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
version: '0'
|
93
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - '>='
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '0'
|
98
|
+
requirements: []
|
99
|
+
rubyforge_project:
|
100
|
+
rubygems_version: 2.2.2
|
101
|
+
signing_key:
|
102
|
+
specification_version: 4
|
103
|
+
summary: rspec support for starting_blocks
|
104
|
+
test_files: []
|