plymouth 0.2.0 → 0.3.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.
- data/README.md +16 -4
- data/lib/plymouth.rb +8 -1
- data/lib/plymouth/version.rb +1 -1
- data/plymouth.gemspec +1 -1
- metadata +7 -7
data/README.md
CHANGED
@@ -3,22 +3,24 @@ plymouth
|
|
3
3
|
|
4
4
|
(C) John Mair (banisterfiend) 2012
|
5
5
|
|
6
|
-
_Start an interactive session
|
6
|
+
_Start an interactive session on test failure_
|
7
7
|
|
8
8
|
**Warning BETA software: Please file an [issue](https://github.com/banister/plymouth) if you have any problems**
|
9
9
|
|
10
10
|
`plymouth` is a gem to automatically start a [Pry](http://pry.github.com) session when a test fails, putting you in the context of the failure.
|
11
11
|
It currently supports [Bacon](https://github.com/chneukirchen/bacon), [Minitest](https://github.com/seattlerb/minitest), and [RSpec](https://github.com/rspec/rspec).
|
12
|
-
Support for other testing libraries is (usually) trivial to add.
|
12
|
+
Support for other testing libraries is (usually) trivial to add.
|
13
13
|
|
14
|
-
plymouth
|
14
|
+
`plymouth` utilizes the powerful [pry-exception_explorer](https://github.com/pry/pry-exception_explorer) gem.
|
15
|
+
|
16
|
+
plymouth currently only runs on **MRI 1.9.2+ (including 1.9.3)**
|
15
17
|
|
16
18
|
* Install the [gem](https://rubygems.org/gems/plymouth): `gem install plymouth`
|
17
19
|
* See the [source code](http://github.com/banister/plymouth)
|
18
20
|
|
19
21
|
**How to use:**
|
20
22
|
|
21
|
-
Simply add the following line to your test
|
23
|
+
Simply add the following line to your test suite:
|
22
24
|
|
23
25
|
`require 'plymouth'`
|
24
26
|
|
@@ -47,6 +49,9 @@ end
|
|
47
49
|
And here is the result of running the above test with the `rspec` executable:
|
48
50
|
|
49
51
|
```ruby
|
52
|
+
Test failure: expected: true
|
53
|
+
got: false (using ==)
|
54
|
+
|
50
55
|
Frame number: 0/14
|
51
56
|
Frame type: block
|
52
57
|
|
@@ -82,6 +87,13 @@ Failed examples:
|
|
82
87
|
rspec ./rspec_intercept.rb:8 # Array should be empty
|
83
88
|
```
|
84
89
|
|
90
|
+
The 'USE_PLYMOUTH' Environment variable
|
91
|
+
-------
|
92
|
+
|
93
|
+
To make it easier to run your test suite normally (without plymouth's intervention) a `USE_PLYMOUTH` environment variable
|
94
|
+
can be defined. If the `USE_PLYMOUTH` environment variable is set to `"false"`, `"0"`, or `"no"` plymouth will not intercept test failures.
|
95
|
+
If `USE_PLYMOUTH` is not defined at all, plymouth will be used by default.
|
96
|
+
|
85
97
|
Limitations
|
86
98
|
-------------------------
|
87
99
|
|
data/lib/plymouth.rb
CHANGED
@@ -4,7 +4,13 @@
|
|
4
4
|
require "plymouth/version"
|
5
5
|
require 'pry-exception_explorer'
|
6
6
|
|
7
|
-
|
7
|
+
if !ENV.has_key?("USE_PLYMOUTH")
|
8
|
+
EE.enabled = true
|
9
|
+
elsif ["0", "false", "no"].include?(ENV["USE_PLYMOUTH"].downcase)
|
10
|
+
EE.enabled = false
|
11
|
+
else
|
12
|
+
EE.enabled = true
|
13
|
+
end
|
8
14
|
|
9
15
|
message = nil
|
10
16
|
|
@@ -23,6 +29,7 @@ if defined?(Bacon)
|
|
23
29
|
else
|
24
30
|
false
|
25
31
|
end
|
32
|
+
|
26
33
|
end.skip_until { |frame| frame.klass == Bacon::Context }
|
27
34
|
|
28
35
|
elsif defined?(RSpec)
|
data/lib/plymouth/version.rb
CHANGED
data/plymouth.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: plymouth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-02-08 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: pry-exception_explorer
|
16
|
-
requirement: &
|
16
|
+
requirement: &70204289865000 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70204289865000
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: bacon
|
27
|
-
requirement: &
|
27
|
+
requirement: &70204289862340 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 1.1.0
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70204289862340
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rspec
|
38
|
-
requirement: &
|
38
|
+
requirement: &70204289733740 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70204289733740
|
47
47
|
description: Start an interactive session when a test fails
|
48
48
|
email: jrmair@gmail.com
|
49
49
|
executables: []
|