Skip to content

Commit

Permalink
Skip certain scenarios if readline is not available
Browse files Browse the repository at this point in the history
  • Loading branch information
mvz committed Sep 8, 2017
1 parent 7982819 commit f5083a3
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Feature: Debug your command in cucumber-test-run
When I successfully run `cucumber`
Then the features should all pass

@requires-readline
Scenario: You can use a debug repl in your cli program

If you want to debug a strange error, which only occures in one of your
Expand Down
4 changes: 4 additions & 0 deletions features/06_use_aruba_cli/open_console.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Feature: Aruba Console
Background:
Given a mocked home directory

@requires-readline
Scenario: Start console
Given I run `aruba console` interactively
When I close the stdin stream
Expand All @@ -12,6 +13,7 @@ Feature: Aruba Console
"""

@unsupported-on-platform-java
@requires-readline
Scenario: Show help
Given I run `aruba console` interactively
And I type "aruba_help"
Expand All @@ -30,6 +32,7 @@ Feature: Aruba Console
"""

@unsupported-on-platform-java
@requires-readline
Scenario: Show methods
Given I run `aruba console` interactively
And I type "aruba_methods"
Expand All @@ -44,6 +47,7 @@ Feature: Aruba Console
"""

@unsupported-on-platform-java
@requires-readline
Scenario: Has history
Given I run `aruba console` interactively
And I type "aruba_methods"
Expand Down
1 change: 1 addition & 0 deletions features/07_development_of_aruba/run-aruba-console.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Feature: Running the interactive "aruba" developer console
I want to use the interactive aruba console
In order to try out the "aruba" api

@requires-readline
Scenario: Running aruba interactively

This starts a pry console with "aruba"'s api loaded.
Expand Down
13 changes: 13 additions & 0 deletions features/step_definitions/hooks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,19 @@
end
end

Before '@requires-readline' do
begin
require 'readline'
next
rescue LoadError
if Cucumber::VERSION < '2'
skip_invoke!
else
skip_this_scenario
end
end
end

Before '@unsupported-on-platform-unix' do |scenario|
# leave if not windows
next unless FFI::Platform.unix?
Expand Down

0 comments on commit f5083a3

Please sign in to comment.