[DRE-commits] [ruby-aruba] 56/98: Fixed tests
Hideki Yamane
henrich at moszumanska.debian.org
Tue Mar 22 12:20:39 UTC 2016
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 9140820fe50957c81d33eb7bb0ad49fb45673010
Author: Dennis Günnewig <dg1 at ratiodata.de>
Date: Mon Jan 4 13:01:55 2016 +0100
Fixed tests
---
features/steps/core/announce.feature | 27 +++++++++++++++++++++++++++
lib/aruba/colorizer.rb | 5 -----
lib/aruba/command.rb | 18 ++++++------------
lib/aruba/platforms/announcer.rb | 4 ++--
4 files changed, 35 insertions(+), 19 deletions(-)
diff --git a/features/steps/core/announce.feature b/features/steps/core/announce.feature
index 24cecae..5a4d370 100644
--- a/features/steps/core/announce.feature
+++ b/features/steps/core/announce.feature
@@ -254,3 +254,30 @@ Feature: Announce output during test run
"""
# executable
"""
+
+ Scenario: Announce content of command
+ This will output the content of the executable command. Be careful doing
+ this with binary executables. This hook should be used with scripts only.
+
+ Given an executable named "bin/cli" with:
+ """bash
+ #!/usr/bin/env bash
+
+ echo 'Hello World'
+ """
+ And a file named "features/exit_status.feature" with:
+ """cucumber
+ Feature: Announce
+ @announce-command-content
+ Scenario: Run command
+ And I run `cli`
+ Then the exit status should be 0
+ """
+ When I run `cucumber`
+ Then the features should all pass
+ And the output should contain:
+ """
+ #!/usr/bin/env bash
+
+ echo 'Hello World'
+ """
diff --git a/lib/aruba/colorizer.rb b/lib/aruba/colorizer.rb
index b922fff..5d61770 100644
--- a/lib/aruba/colorizer.rb
+++ b/lib/aruba/colorizer.rb
@@ -67,8 +67,6 @@ module Aruba
result << "\e[0m" if Aruba::AnsiColor.coloring?
result
end
-
- module_function c
end
# Regular expression that is used to scan for ANSI-sequences while
@@ -100,9 +98,6 @@ module Aruba
def attributes
ATTRIBUTE_NAMES
end
-
- # extend self
- module_function :attributes, :uncolored
end
end
diff --git a/lib/aruba/command.rb b/lib/aruba/command.rb
index 8fcf0e5..352722a 100644
--- a/lib/aruba/command.rb
+++ b/lib/aruba/command.rb
@@ -50,30 +50,24 @@ module Aruba
# Stop command
def stop(*)
- unless __getobj__.stopped?
- __getobj__.stop
- event_bus.notify Events::CommandStopped.new(self)
- end
+ __getobj__.stop
+ event_bus.notify Events::CommandStopped.new(self)
self
end
# Terminate command
def terminate(*)
- unless __getobj__.stopped?
- __getobj__.terminate
- event_bus.notify Events::CommandStopped.new(self)
- end
+ __getobj__.terminate
+ event_bus.notify Events::CommandStopped.new(self)
self
end
# Start command
def start
- unless __getobj__.started?
- __getobj__.start
- event_bus.notify Events::CommandStarted.new(self)
- end
+ __getobj__.start
+ event_bus.notify Events::CommandStarted.new(self)
self
end
diff --git a/lib/aruba/platforms/announcer.rb b/lib/aruba/platforms/announcer.rb
index af94b0f..0b5330e 100644
--- a/lib/aruba/platforms/announcer.rb
+++ b/lib/aruba/platforms/announcer.rb
@@ -156,8 +156,8 @@ module Aruba
#
# @param [Symbol] channel
# The name of the channel to activate
- def activate(*channels)
- channels.flatten.each { |c| channels[c.to_sym] = true }
+ def activate(*chns)
+ chns.flatten.each { |c| channels[c.to_sym] = true }
self
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