gurke 2.0.3 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0654d04ad2d23777d20d4a93d8a20efe84e42def
4
- data.tar.gz: ac53033b69f6ba0a14a118faef206a872d09d9c5
3
+ metadata.gz: 9c12df541b21f5f76f5956d731764ec23b85e4ac
4
+ data.tar.gz: 8397ac6205619fc8667afc0f0694beb0ce395a99
5
5
  SHA512:
6
- metadata.gz: f1c2af5ef27ae6c6b78cdb2cdc5d11ef661e487670187dbbeea815503926ebbc12926b9d1d54b4f9651f680b1061835e0eda94dca1a6b510455d700fb12759cc
7
- data.tar.gz: 0dc90b6af92339d46b15bfa5380395d4b3d39769ea2c2924e2e45d41a29f3422e2f1aab9fa9120d536e2d3d4ff0de193f1b719ecf5b1ae470912410d1f2341a4
6
+ metadata.gz: e54e0281307bf79d2bea76bf7c0a9b3d84f677669810be1fc0e65a6a6c537700a2869a4969d0ab19fc6e34c5d3c3d3368a97f25136948884bc26a5f5a2aab8d7
7
+ data.tar.gz: 490ad37a6ad2a9f3d15db99ec35eabf2694fd82ab5256578d4d1351d63ff9d6241e626dafead371309512b8633f080fdae5edf66604a108399488b846b1c84e6
@@ -85,11 +85,32 @@ module Gurke::Reporters
85
85
  def print_failed(step)
86
86
  print_braces red('failure')
87
87
  io.puts
88
- msg = step.exception.message.split("\n").join("\n ")
89
88
 
90
- io.puts red(" #{step.exception.class}:")
91
- io.puts red(" #{msg}")
92
- io.puts red(" #{step.exception.backtrace.join("\n ")}")
89
+ exout = format_exception(step.exception)
90
+ io.puts exout.map{|s| red(" #{s}\n") }.join
91
+ end
92
+
93
+ def format_exception(ex)
94
+ s = [ex.message.strip]
95
+ if ex.backtrace.nil?
96
+ s << ' <no backtrace available>'
97
+ elsif ex.backtrace.empty?
98
+ s << ' <backtrace empty>'
99
+ else
100
+ ex.backtrace.each do |bt|
101
+ s << ' ' + bt.strip
102
+ end
103
+ end
104
+
105
+ if ex.respond_to?(:cause) && ex.cause &&
106
+ ex.cause.respond_to?(:message) && ex.cause.respond_to?(:backtrace)
107
+
108
+ cause = format_exception(ex.cause)
109
+ s << 'caused by: ' + cause.shift
110
+ s += cause
111
+ end
112
+
113
+ s
93
114
  end
94
115
 
95
116
  [:black, :red, :green, :yellow, :blue,
@@ -1,8 +1,8 @@
1
1
  module Gurke
2
2
  module VERSION
3
3
  MAJOR = 2
4
- MINOR = 0
5
- PATCH = 3
4
+ MINOR = 1
5
+ PATCH = 0
6
6
  STAGE = nil
7
7
  STRING = [MAJOR, MINOR, PATCH, STAGE].reject(&:nil?).join('.').freeze
8
8
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gurke
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.3
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Graichen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-24 00:00:00.000000000 Z
11
+ date: 2014-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: trollop