cuken 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{cuken}
8
- s.version = "0.1.0"
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",
@@ -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" is required
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 do aruba I run "echo 'i like cheese'"
15
- Then I see aruba the stdout from "echo 'i like cheese'" should contain "i like cheese"
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 do aruba I run "echo 'i like cheese' 1>&2"
19
- Then I see aruba the stderr from "echo 'i like cheese' 1>&2" should contain "i like cheese"
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'"
@@ -6,6 +6,9 @@ Feature: Examining files
6
6
  As an administrator
7
7
  I want to examine files
8
8
 
9
+ Background
10
+ Given that "cuken/file" has been required
11
+
9
12
  @steps
10
13
  Scenario: File exists
11
14
  Given the empty file "foo.file"
@@ -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" is required
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
 
@@ -6,10 +6,6 @@ Given /^that "([^\"]*)" has been required$/ do |lib|
6
6
  require(lib).should be_false
7
7
  end
8
8
 
9
- Given /^that "([^\"]*)" is required$/ do |lib|
10
- require(lib).should be_false
11
- end
12
-
13
9
  When /^I do aruba (.*)$/ do |aruba_step|
14
10
  begin
15
11
  When(aruba_step)
@@ -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
@@ -1,3 +1,6 @@
1
1
  require 'pathname'
2
2
  require 'aruba/cucumber' unless defined? Aruba
3
3
 
4
+ require 'cuken/api/common'
5
+ require 'cuken/cucumber/common'
6
+
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.0
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: 4582846900001686992
181
+ hash: 622770599856717010
181
182
  segments:
182
183
  - 0
183
184
  version: "0"