plymouth 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
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 when a test fails_
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 currently only supports **MRI 1.9.2+ (including 1.9.3)**
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 files:
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
- EE.enabled = true
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)
@@ -1,3 +1,3 @@
1
1
  module Plymouth
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
data/plymouth.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "plymouth"
5
- s.version = "0.2.0"
5
+ s.version = "0.3.0"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["John Mair (banisterfiend)"]
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.2.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: &70323999883060 !ruby/object:Gem::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: *70323999883060
24
+ version_requirements: *70204289865000
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: bacon
27
- requirement: &70323999880480 !ruby/object:Gem::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: *70323999880480
35
+ version_requirements: *70204289862340
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec
38
- requirement: &70323999864420 !ruby/object:Gem::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: *70323999864420
46
+ version_requirements: *70204289733740
47
47
  description: Start an interactive session when a test fails
48
48
  email: jrmair@gmail.com
49
49
  executables: []