cuken 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/cuken.gemspec +2 -1
- data/features/commands.feature +5 -6
- data/features/files.feature +3 -0
- data/features/ssh.feature +1 -2
- data/features/step_definitions/cuken_steps.rb +0 -4
- data/lib/cuken/api/common.rb +31 -0
- data/lib/cuken/common.rb +3 -0
- data/lib/cuken/cucumber/common.rb +0 -0
- metadata +3 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
data/cuken.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{cuken}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Hedgehog"]
|
@@ -41,6 +41,7 @@ Gem::Specification.new do |s|
|
|
41
41
|
"lib/cuken/cmd.rb",
|
42
42
|
"lib/cuken/common.rb",
|
43
43
|
"lib/cuken/cucumber/cmd.rb",
|
44
|
+
"lib/cuken/cucumber/common.rb",
|
44
45
|
"lib/cuken/cucumber/file.rb",
|
45
46
|
"lib/cuken/cucumber/ssh.rb",
|
46
47
|
"lib/cuken/file.rb",
|
data/features/commands.feature
CHANGED
@@ -7,16 +7,15 @@ Feature: Executing commands
|
|
7
7
|
I want to use Aruba steps to run commands and test output
|
8
8
|
|
9
9
|
Background:
|
10
|
-
Given that "cuken/cmd"
|
11
|
-
# Given the Gem "aruba" has been required
|
10
|
+
Given that "cuken/cmd" has been required
|
12
11
|
|
13
12
|
Scenario: Check Stdout
|
14
|
-
When I
|
15
|
-
Then
|
13
|
+
When I run "echo 'i like cheese'"
|
14
|
+
Then the stdout from "echo 'i like cheese'" should contain "i like cheese"
|
16
15
|
|
17
16
|
Scenario: Check Stderr
|
18
|
-
When I
|
19
|
-
Then
|
17
|
+
When I run "some_error"
|
18
|
+
Then the stderr from "some_error" should contain "No such file or directory - some_error"
|
20
19
|
|
21
20
|
Scenario: Check Stdout for multiple lines
|
22
21
|
When I run "echo 'one\none\none\n'"
|
data/features/files.feature
CHANGED
data/features/ssh.feature
CHANGED
@@ -7,8 +7,7 @@ Feature: SSH steps
|
|
7
7
|
I want to use Aruba and custom steps to describe SSH sessions
|
8
8
|
|
9
9
|
Background:
|
10
|
-
Given that "cuken/ssh"
|
11
|
-
And the Gem "ssh-forever" has been required
|
10
|
+
Given that "cuken/ssh" has been required
|
12
11
|
And default ssh-forever options
|
13
12
|
And I initialize password-less SSH access
|
14
13
|
|
data/lib/cuken/api/common.rb
CHANGED
@@ -1 +1,32 @@
|
|
1
1
|
require 'aruba/api' unless defined? Aruba::Api
|
2
|
+
|
3
|
+
module ::Cuken
|
4
|
+
module Api
|
5
|
+
module Common
|
6
|
+
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
#
|
12
|
+
# We strip ANSI code from output strings.
|
13
|
+
#
|
14
|
+
module ::Aruba
|
15
|
+
class Process
|
16
|
+
def remove_ansi_codes(str)
|
17
|
+
str.gsub(/\e\[(\d+)m/, '')
|
18
|
+
end
|
19
|
+
def stdout
|
20
|
+
wait_for_io do
|
21
|
+
@out.rewind
|
22
|
+
remove_ansi_codes(@out.read)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
def stderr
|
26
|
+
wait_for_io do
|
27
|
+
@err.rewind
|
28
|
+
remove_ansi_codes(@err.read)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
data/lib/cuken/common.rb
CHANGED
File without changes
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: cuken
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.1.
|
5
|
+
version: 0.1.1
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Hedgehog
|
@@ -157,6 +157,7 @@ files:
|
|
157
157
|
- lib/cuken/cmd.rb
|
158
158
|
- lib/cuken/common.rb
|
159
159
|
- lib/cuken/cucumber/cmd.rb
|
160
|
+
- lib/cuken/cucumber/common.rb
|
160
161
|
- lib/cuken/cucumber/file.rb
|
161
162
|
- lib/cuken/cucumber/ssh.rb
|
162
163
|
- lib/cuken/file.rb
|
@@ -177,7 +178,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
177
178
|
requirements:
|
178
179
|
- - ">="
|
179
180
|
- !ruby/object:Gem::Version
|
180
|
-
hash:
|
181
|
+
hash: 622770599856717010
|
181
182
|
segments:
|
182
183
|
- 0
|
183
184
|
version: "0"
|