rspec-instafail 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/Readme.md CHANGED
@@ -3,16 +3,18 @@ Show failing specs instantly. Show passing spec as green dots as usual.
3
3
  Output
4
4
  ======
5
5
  ....................................................*....
6
- 1: User as seller should be a seller when it has an activated shop
7
- -> expected is_seller? to return false, got true
6
+ 1) ApplicationController#sign_out_and_redirect with JSON should return JSON indicating success
7
+ Failure/Error: json_response = JSON.parse response.body
8
+ A JSON text must at least contain two octets!
9
+ # /Users/miwillhite/.rvm/gems/ruby-1.9.2-p0/gems/json_pure-1.4.6/lib/json/common.rb:146:in `initialize'
10
+ # /Users/miwillhite/.rvm/gems/ruby-1.9.2-p0/gems/json_pure-1.4.6/lib/json/common.rb:146:in `new'
11
+ # /Users/miwillhite/.rvm/gems/ruby-1.9.2-p0/gems/json_pure-1.4.6/lib/json/common.rb:146:in `parse'
12
+ # ./spec/controllers/application_controller_spec.rb:17:in `block (4 levels) in <top (required)>'
8
13
  ..................................................................
9
- 2: Product validations is invalid with too short title
10
- -> expected not: == 1,
11
- got: 1
12
- ............................................................
14
+
13
15
  Finished in 650.095614 seconds
14
16
 
15
- 1680 examples, 2 failure, 1 pending
17
+ 1680 examples, 1 failure, 1 pending
16
18
 
17
19
 
18
20
 
@@ -21,19 +23,24 @@ Install
21
23
  As Gem:
22
24
  gem install rspec-instafail
23
25
 
24
- # spec/spec.opts
26
+ # spec/spec.opts (.rspec for rspec 2)
25
27
  --require rspec/instafail
26
28
  --format RSpec::Instafail
27
29
 
28
30
  As plugin:
29
- script/plugin install git://github.com/grosser/rspec-instafail.git
31
+ rails plugin install git://github.com/grosser/rspec-instafail.git
30
32
 
31
- # spec/spec.opts
33
+ # spec/spec.opts (.rspec for rspec 2)
32
34
  --require vendor/plugins/rspec-instafail/lib/rspec/instafail
33
35
  --format RSpec::Instafail
34
36
 
35
- Author
36
- ======
37
+ Authors
38
+ =======
39
+
40
+ ### [Contributors](http://github.com/grosser/rspec-instafail/contributors)
41
+ - [Matthew Willhite](http://github.com/miwillhite)
42
+
43
+
37
44
  [Michael Grosser](http://pragmatig.wordpress.com)
38
45
  grosser.michael@gmail.com
39
- Hereby placed under public domain, do what you want, just do not hold me accountable...
46
+ Hereby placed under public domain, do what you want, just do not hold me accountable...
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -4,11 +4,26 @@ module RSpec
4
4
  require 'spec/runner/formatter/progress_bar_formatter'
5
5
  class Instafail < Spec::Runner::Formatter::ProgressBarFormatter
6
6
  def example_failed(example, counter, failure)
7
+ short_padding = ' '
8
+ padding = ' '
9
+
7
10
  output.puts
8
- output.puts red("#{counter}: #{example_group.description} #{example.description}")
9
- output.puts " -> #{failure.exception}"
11
+ output.puts red("#{short_padding}#{counter}) #{example_group.description} #{example.description}")
12
+ output.puts "#{padding}#{red(failure.exception)}"
13
+
14
+ format_backtrace(failure.exception.backtrace).each do |backtrace_info|
15
+ output.puts insta_gray("#{padding}# #{backtrace_info.strip}")
16
+ end
17
+
10
18
  output.flush
11
19
  end
20
+
21
+ private
22
+
23
+ # there is a gray() that returns nil, so we use our own...
24
+ def insta_gray(text)
25
+ colour(text, "\e[90m")
26
+ end
12
27
  end
13
28
  Instafail
14
29
  else
@@ -19,9 +34,20 @@ module RSpec
19
34
  def example_failed(example)
20
35
  @counter ||= 0
21
36
  @counter += 1
37
+
38
+ exception = example.metadata[:execution_result][:exception_encountered]
39
+ short_padding = ' '
40
+ padding = ' '
41
+
22
42
  output.puts
23
- output.puts red("#{@counter}: #{example.example_group.description} #{example.description}")
24
- output.puts " -> #{example.metadata[:execution_result][:exception_encountered]}"
43
+ output.puts "#{short_padding}#{@counter}) #{example.full_description}"
44
+ output.puts "#{padding}#{red("Failure/Error:")} #{red(read_failed_line(exception, example).strip)}"
45
+ output.puts "#{padding}#{red(exception)}"
46
+
47
+ format_backtrace(exception.backtrace, example).each do |backtrace_info|
48
+ output.puts grey("#{padding}# #{backtrace_info}")
49
+ end
50
+
25
51
  output.flush
26
52
  end
27
53
  end
@@ -29,4 +55,4 @@ module RSpec
29
55
  end
30
56
 
31
57
  klass::VERSION = File.read( File.join(File.dirname(__FILE__),'..','..','VERSION') ).strip
32
- end
58
+ end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rspec-instafail}
8
- s.version = "0.1.0"
8
+ s.version = "0.1.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Michael Grosser"]
12
- s.date = %q{2010-08-15}
12
+ s.date = %q{2010-10-22}
13
13
  s.email = %q{grosser.michael@gmail.com}
14
14
  s.files = [
15
15
  "Rakefile",
@@ -1,2 +1,2 @@
1
1
  source 'http://rubygems.org'
2
- gem 'rspec', '2.0.0.beta.19'
2
+ gem 'rspec', '>=2'
@@ -2,17 +2,19 @@ GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
4
  diff-lcs (1.1.2)
5
- rspec (2.0.0.beta.19)
6
- rspec-core (= 2.0.0.beta.19)
7
- rspec-expectations (= 2.0.0.beta.19)
8
- rspec-mocks (= 2.0.0.beta.19)
9
- rspec-core (2.0.0.beta.19)
10
- rspec-expectations (2.0.0.beta.19)
5
+ rspec (2.0.1)
6
+ rspec-core (~> 2.0.1)
7
+ rspec-expectations (~> 2.0.1)
8
+ rspec-mocks (~> 2.0.1)
9
+ rspec-core (2.0.1)
10
+ rspec-expectations (2.0.1)
11
11
  diff-lcs (>= 1.1.2)
12
- rspec-mocks (2.0.0.beta.19)
12
+ rspec-mocks (2.0.1)
13
+ rspec-core (~> 2.0.1)
14
+ rspec-expectations (~> 2.0.1)
13
15
 
14
16
  PLATFORMS
15
17
  ruby
16
18
 
17
19
  DEPENDENCIES
18
- rspec (= 2.0.0.beta.19)
20
+ rspec (>= 2)
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 0
9
- version: 0.1.0
8
+ - 1
9
+ version: 0.1.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Michael Grosser
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-08-15 00:00:00 +02:00
17
+ date: 2010-10-22 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies: []
20
20