cukerail 0.1.1 → 0.1.2

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: 4a0e2d59e57bd19d32d06e7d9d8047a365f7b8ad
4
- data.tar.gz: fac0d37fb5beb3713429f82fa84102bc12949f5a
3
+ metadata.gz: 79f05604565fe68cea1631b80c6627ce31b8407e
4
+ data.tar.gz: 5a8729dd85cef095455869f98fcca70bd643f436
5
5
  SHA512:
6
- metadata.gz: b1a07913212d023584012ee615527cb3786568bf8b70621cf2a074f1ef54b4f73eb0298a5fec2648c95d34035d9c1e8a3e24c4a15633ba4054069989832ee5a2
7
- data.tar.gz: b7d375108aa2e8ce8b74ed86147dea5a04fd6e9e4a9f668295d6a54f02b5eaf488aefe5846b6982fdbbf1e1f01786f842d86babe6961ac63c0865c7b4f1135af
6
+ metadata.gz: ece6e0a05572fc1705fdcf76ffb2caa03867c52a3d1f14ad2a48784ab24e913c64b351667df84bd3704fadcd0e4a0ef1356e22bfcc39863388a2d7c0906d613d
7
+ data.tar.gz: 6091144fd6996b46076d81d0f1c5c7c956c8fa476175eb815875a48434c1ac0adb0c4ca3357b88210d1261753d6be0bfd9701a42ca683456046426c4dde1f526
@@ -1,3 +1,3 @@
1
1
  module Cukerail
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
data/lib/cukerail.rb CHANGED
@@ -87,7 +87,9 @@ module Cukerail
87
87
  end
88
88
 
89
89
  def send_steps(test_case,id)
90
- steps_as_string = test_case.test_steps.map{|step| step.source.last}.select{|step| step.is_a?(Cucumber::Core::Ast::Step)}.map do | step |
90
+ steps_as_string = test_case.test_steps.map{|step| step.source.last}
91
+ .select{|step| step.is_a?(Cucumber::Core::Ast::Step) && step.respond_to?(:gherkin_statement)}
92
+ .reject{|step| step.is_a?(Cucumber::Hooks::BeforeHook)}.map do | step |
91
93
  g = step.gherkin_statement
92
94
  str = g.keyword+g.name
93
95
  g.rows.each do | row |
@@ -127,10 +129,18 @@ module Cukerail
127
129
  {id:6,comment: 'pending step'}
128
130
  end
129
131
  unless result.passed?
132
+ # the before step can fail. So we have to check
133
+ if @failed_step[:step].source.last.is_a?(Cucumber::Hooks::BeforeHook)
134
+ failed_step = 'failed in the before hook'
135
+ location = 'before hook'
136
+ else
137
+ failed_step = "#{@failed_step[:step].source.last.keyword}#{@failed_step[:step].source.last.name}"
138
+ location=@failed_step[:step].source.last.file_colon_line
139
+ end
130
140
  failure_message = <<-FAILURE
131
141
  Error message: #{testrail_status[:comment]} #{result.exception.message}
132
- Step: #{@failed_step[:step].source.last.keyword}#{@failed_step[:step].source.last.name}
133
- Location: #{@failed_step[:step].source.last.file_colon_line}
142
+ Step: #{failed_step}
143
+ Location: #{location}
134
144
  FAILURE
135
145
  else
136
146
  failure_message = nil
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cukerail
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Small
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-23 00:00:00.000000000 Z
11
+ date: 2015-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler