[DRE-commits] [ruby-aruba] 16/74: Refactor step places from core to command
Hideki Yamane
henrich at moszumanska.debian.org
Sat Nov 28 01:16:30 UTC 2015
This is an automated email from the git hooks/post-receive script.
henrich pushed a commit to branch debian/sid
in repository ruby-aruba.
commit b1fcbf899c2e2fa0cc3d3d29f99a23a229e0c0d9
Author: Max Meyer <dev at fedux.org>
Date: Tue Nov 24 10:11:57 2015 +0100
Refactor step places from core to command
---
lib/aruba/cucumber/command.rb | 59 ++++++++++++++++++++++++++++++++++---------
lib/aruba/cucumber/core.rb | 28 --------------------
2 files changed, 47 insertions(+), 40 deletions(-)
diff --git a/lib/aruba/cucumber/command.rb b/lib/aruba/cucumber/command.rb
index 6b46d53..8683d79 100644
--- a/lib/aruba/cucumber/command.rb
+++ b/lib/aruba/cucumber/command.rb
@@ -1,3 +1,7 @@
+if Aruba::VERSION < '1.0.0'
+ require 'aruba/cucumber/core'
+end
+
When(/^I run "(.*)"$/)do |cmd|
warn(%{\e[35m The /^I run "(.*)"$/ step definition is deprecated. Please use the `backticks` version\e[0m})
@@ -54,19 +58,7 @@ When(/^I pipe in (?:a|the) file(?: named)? "([^"]*)"$/) do |file|
close_input
end
-When(/^I stop the command (?:"([^"]*)"|(?:started last))$/) do |command|
- if command
- cmd = all_commands.find { |c| c.commandline == command }
- fail ArgumentError, %(No command "#{command}" found) if cmd.nil?
- cmd.stop(announcer)
- else
- last_command_started.stop(announcer)
- end
-end
-
When(/^I (terminate|stop) the command (?:"([^"]*)"|(?:started last))$/) do |signal, command|
- sleep 10
-
if command
cmd = all_commands.find { |c| c.commandline == command }
fail ArgumentError, %(No command "#{command}" found) if cmd.nil?
@@ -368,3 +360,46 @@ Then(/^(?:the )?(output|stdout|stderr) should( not)? contain all of these lines:
end
end
end
+
+Given(/the default aruba timeout is (\d+) seconds/) do |seconds|
+ # rubocop:disable Metrics/LineLength
+ Aruba.platform.deprecated(%{The /^the default aruba timeout is (\d+) seconds/ step definition is deprecated. Please use /^the default aruba exit timeout is (\d+) seconds/ step definition is deprecated.})
+ # rubocop:enable Metrics/LineLength
+
+ aruba.config.exit_timeout = seconds.to_i
+end
+
+Given(/The default aruba timeout is (\d+) seconds/) do |seconds|
+ # rubocop:disable Metrics/LineLength
+ Aruba.platform.deprecated(%{The /^The default aruba timeout is (\d+) seconds/ step definition is deprecated. Please use /^the default aruba exit timeout is (\d+) seconds/ step definition is deprecated.})
+ # rubocop:enable Metrics/LineLength
+
+ aruba.config.exit_timeout = seconds.to_i
+end
+
+Given(/^the (?:default )?aruba io wait timeout is (\d+) seconds?$/) do |seconds|
+ aruba.config.io_wait_timeout = seconds.to_i
+end
+
+Given(/^the (?:default )?aruba exit timeout is (\d+) seconds?$/) do |seconds|
+ aruba.config.exit_timeout = seconds.to_i
+end
+
+Given(/^the (?:default )?aruba stop signal is "([^"]*)"$/) do |signal|
+ aruba.config.stop_signal = signal
+end
+
+Given(/^I wait (\d+) seconds? for a command to start up$/) do |seconds|
+ aruba.config.startup_wait_time = seconds.to_i
+end
+
+When(/^I send the signal "([^"]*)" to the command (?:"([^"]*)"|(?:started last))$/) do |signal, command|
+ if command
+ cmd = all_commands.find { |c| c.commandline == command }
+ fail ArgumentError, %(No command "#{command}" found) if cmd.nil?
+
+ cmd.send_signal signal
+ else
+ last_command_started.send_signal signal
+ end
+end
diff --git a/lib/aruba/cucumber/core.rb b/lib/aruba/cucumber/core.rb
index fd2ba3c..e7690a2 100644
--- a/lib/aruba/cucumber/core.rb
+++ b/lib/aruba/cucumber/core.rb
@@ -3,31 +3,3 @@ if Aruba::VERSION >= '1.0.0'
config.working_directory = 'tmp/cucumber'
end
end
-
-Given(/the default aruba timeout is (\d+) seconds/) do |seconds|
- # rubocop:disable Metrics/LineLength
- Aruba.platform.deprecated(%{The /^the default aruba timeout is (\d+) seconds/ step definition is deprecated. Please use /^the default aruba exit timeout is (\d+) seconds/ step definition is deprecated.})
- # rubocop:enable Metrics/LineLength
-
- aruba.config.exit_timeout = seconds.to_i
-end
-
-Given(/The default aruba timeout is (\d+) seconds/) do |seconds|
- # rubocop:disable Metrics/LineLength
- Aruba.platform.deprecated(%{The /^The default aruba timeout is (\d+) seconds/ step definition is deprecated. Please use /^the default aruba exit timeout is (\d+) seconds/ step definition is deprecated.})
- # rubocop:enable Metrics/LineLength
-
- aruba.config.exit_timeout = seconds.to_i
-end
-
-Given(/the default aruba io wait timeout is (\d+) seconds?/) do |seconds|
- aruba.config.io_wait_timeout = seconds.to_i
-end
-
-Given(/the default aruba exit timeout is (\d+) seconds?/) do |seconds|
- aruba.config.exit_timeout = seconds.to_i
-end
-
-Given(/the default aruba stop signal is "([^"]*)"/) do |signal|
- aruba.config.stop_signal = signal
-end
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-aruba.git
More information about the Pkg-ruby-extras-commits
mailing list