kanoah_rspec_formatter 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/kanoah_rspec_formatter/rspec_steps.rb +10 -3
- data/lib/kanoah_rspec_formatter/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f9301421d9f1cda03dd754dade49004c8224f69f
|
4
|
+
data.tar.gz: d27aa4fae72f69d10ac6e6fa3dba2e2f39b4d322
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 64bd12f441b27dcd36f602e78f863cf4a4338114afdf8538c4923eba277e3f72b857488de22f70a009886fd8f87fa07675a58dc9d2df9415c6615129036718ce
|
7
|
+
data.tar.gz: 10128881c99197172981ea9829227311b5d5653d6aad6ab6d451874faa1a3867ee19aa4661e492e677e09773354d7dab304c24960ac74c175438817bb75b407a
|
@@ -1,16 +1,23 @@
|
|
1
1
|
module KanoahRSpecFormatter
|
2
2
|
module Example
|
3
|
-
def step(
|
3
|
+
def step(step, options = {}, &block)
|
4
4
|
@metadata[:steps] = [] if @metadata[:steps].nil?
|
5
5
|
begin
|
6
6
|
yield block
|
7
|
-
@metadata[:steps].push({ step_name:
|
7
|
+
@metadata[:steps].push({ step_name: step,index: @metadata[:step_index], status: 'Pass' })
|
8
8
|
rescue Exception => e
|
9
|
-
|
9
|
+
binding.pry
|
10
|
+
@metadata[:steps].push({ step_name: step, index: @metadata[:step_index], status: 'Fail', comment: process_exception(e) })
|
10
11
|
fail
|
11
12
|
ensure
|
12
13
|
@metadata[:step_index] += 1 if @metadata.has_key?(:step_index)
|
13
14
|
end
|
14
15
|
end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
def process_exception(exception)
|
20
|
+
exception.is_a?(RSpec::Expectations::MultipleExpectationsNotMetError) ? exception.failures : exception
|
21
|
+
end
|
15
22
|
end
|
16
23
|
end
|