File tree Expand file tree Collapse file tree 4 files changed +40
-0
lines changed
Expand file tree Collapse file tree 4 files changed +40
-0
lines changed Original file line number Diff line number Diff line change 11<%
22cucumber_pro_opts = ENV['ENABLE_CUCUMBER_PRO'] ? "--format Cucumber::Pro --out /dev/null" : ""
33std_opts = "--format progress features -r features --strict #{cucumber_pro_opts}".dup
4+ std_opts << " --tags 'not @wip'"
45std_opts << " --tags 'not @wip-jruby'" if defined?(JRUBY_VERSION)
56
67wip_opts = "--color -r features".dup
Original file line number Diff line number Diff line change 11# language: no
22# encoding: iso-8859-1
3+ @wip
34Egenskap : Alle bruker ikke UTF-8
45 Scenario : Dette bør gå bra
56 Når jeg drikker en "øl"
Original file line number Diff line number Diff line change @@ -112,12 +112,14 @@ def find_after_step_hooks(test_case)
112112 end
113113
114114 def apply_before_hooks ( test_case )
115+ return test_case if test_case . test_steps . empty?
115116 scenario = RunningTestCase . new ( test_case )
116117 hooks = registry . hooks_for ( :before , scenario )
117118 BeforeHooks . new ( hooks , scenario ) . apply_to ( test_case )
118119 end
119120
120121 def apply_after_hooks ( test_case )
122+ return test_case if test_case . test_steps . empty?
121123 scenario = RunningTestCase . new ( test_case )
122124 hooks = registry . hooks_for ( :after , scenario )
123125 AfterHooks . new ( hooks , scenario ) . apply_to ( test_case )
Original file line number Diff line number Diff line change @@ -12,5 +12,41 @@ module Cucumber
1212 @rb = subject . ruby
1313 Object . new . extend ( RbSupport ::RbDsl )
1414 end
15+
16+ describe '#apply_before_hooks' do
17+ let ( :test_case ) { double }
18+ let ( :test_step ) { double }
19+
20+ it 'applies before hooks to test cases with steps' do
21+ allow ( test_case ) . to receive ( :test_steps ) . and_return ( [ test_step ] )
22+ allow ( test_case ) . to receive ( :with_steps ) . and_return ( double )
23+
24+ expect ( subject . apply_before_hooks ( test_case ) ) . not_to equal ( test_case )
25+ end
26+
27+ it 'does not apply before hooks to test cases with no steps' do
28+ allow ( test_case ) . to receive ( :test_steps ) . and_return ( [ ] )
29+
30+ expect ( subject . apply_before_hooks ( test_case ) ) . to equal ( test_case )
31+ end
32+ end
33+
34+ describe '#apply_after_hooks' do
35+ let ( :test_case ) { double }
36+ let ( :test_step ) { double }
37+
38+ it 'applies after hooks to test cases with steps' do
39+ allow ( test_case ) . to receive ( :test_steps ) . and_return ( [ test_step ] )
40+ allow ( test_case ) . to receive ( :with_steps ) . and_return ( double )
41+
42+ expect ( subject . apply_after_hooks ( test_case ) ) . not_to equal ( test_case )
43+ end
44+
45+ it 'does not apply after hooks to test cases with no steps' do
46+ allow ( test_case ) . to receive ( :test_steps ) . and_return ( [ ] )
47+
48+ expect ( subject . apply_after_hooks ( test_case ) ) . to equal ( test_case )
49+ end
50+ end
1551 end
1652end
You can’t perform that action at this time.
0 commit comments