aruba-turnip 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/aruba-turnip.gemspec +1 -0
- data/lib/aruba/turnip.rb +2 -0
- data/lib/aruba/turnip/command.rb +10 -2
- data/lib/aruba/turnip/environment.rb +42 -0
- data/lib/aruba/turnip/file.rb +1 -3
- data/lib/aruba/turnip/placeholders.rb +15 -0
- data/lib/aruba/turnip/text.rb +7 -0
- data/lib/aruba/turnip/version.rb +1 -1
- data/spec/spec_helper.rb +6 -1
- data/spec/support/simplecov.rb +5 -0
- metadata +19 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 98df6b874f110cd2f99d1216595eba0b72a11ec5
|
4
|
+
data.tar.gz: bad8a425c428e1ab0e74d6441ee34a61073db0cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa7f35a3442591bb7755a5090de92cf125b8644c28f5d9005748ed8da242979fd28d3429cff39758e06e8bc1ba4bb6a0d42403b1c06e8d721a60857c23733432
|
7
|
+
data.tar.gz: 50c393079c651921b15240aa9e3287fb7c86899d66b0ec178bca01f49f61465c63a744ebb0c8bfc03a69698ec15269cbca5dffbaaac940d96413b9e6f628a317
|
data/aruba-turnip.gemspec
CHANGED
@@ -26,5 +26,6 @@ in projects tested with RSpec and Turnip.
|
|
26
26
|
spec.add_development_dependency "bundler", "~> 1.13"
|
27
27
|
spec.add_development_dependency "rake", "~> 10.0"
|
28
28
|
spec.add_development_dependency "rspec", "~> 3"
|
29
|
+
spec.add_development_dependency "simplecov"
|
29
30
|
spec.add_development_dependency "turnip"
|
30
31
|
end
|
data/lib/aruba/turnip.rb
CHANGED
data/lib/aruba/turnip/command.rb
CHANGED
@@ -39,14 +39,22 @@ step 'I run `([^`]*)` in background'do |cmd|
|
|
39
39
|
run(sanitize_text(cmd))
|
40
40
|
end
|
41
41
|
|
42
|
-
|
43
|
-
|
42
|
+
=end
|
43
|
+
|
44
|
+
step 'I type :text' do |input|
|
45
|
+
type(input)
|
46
|
+
end
|
47
|
+
|
48
|
+
step 'I type:' do |input|
|
49
|
+
type(input)
|
44
50
|
end
|
45
51
|
|
46
52
|
step 'I close the stdin stream' do
|
47
53
|
close_input
|
48
54
|
end
|
49
55
|
|
56
|
+
=begin
|
57
|
+
|
50
58
|
step 'I pipe in (?:a|the) file(?: named)? "([^"]*)"' do |file|
|
51
59
|
pipe_in_file(file)
|
52
60
|
|
@@ -0,0 +1,42 @@
|
|
1
|
+
step "a mocked home directory" do
|
2
|
+
set_environment_variable 'HOME', expand_path('.')
|
3
|
+
end
|
4
|
+
|
5
|
+
step "I set the environment variable \":variable\" to \":value\"" do |variable, value|
|
6
|
+
set_environment_variable(variable.to_s, value.to_s)
|
7
|
+
end
|
8
|
+
|
9
|
+
step "I append \":value\" to the environment variable \"(.*)\"" do |value, variable|
|
10
|
+
append_environment_variable(variable.to_s, value.to_s)
|
11
|
+
end
|
12
|
+
|
13
|
+
step "I prepend \"(.*)\" to the environment variable \"(.*)\"" do |value, variable|
|
14
|
+
prepend_environment_variable(variable.to_s, value.to_s)
|
15
|
+
end
|
16
|
+
|
17
|
+
step "I set the environment variables? to:" do |table|
|
18
|
+
table.hashes.each do |row|
|
19
|
+
variable = row['variable'].to_s
|
20
|
+
value = row['value'].to_s
|
21
|
+
|
22
|
+
set_environment_variable(variable, value)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
step "I append the values? to the environment variables?:" do |table|
|
27
|
+
table.hashes.each do |row|
|
28
|
+
variable = row['variable'].to_s
|
29
|
+
value = row['value'].to_s
|
30
|
+
|
31
|
+
append_environment_variable(variable, value)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
step "I prepend the values? to the environment variables?:" do |table|
|
36
|
+
table.hashes.each do |row|
|
37
|
+
variable = row['variable'].to_s
|
38
|
+
value = row['value'].to_s
|
39
|
+
|
40
|
+
prepend_environment_variable(variable, value)
|
41
|
+
end
|
42
|
+
end
|
data/lib/aruba/turnip/file.rb
CHANGED
@@ -31,11 +31,9 @@ step '(an/the) executable (named) ":file_name" with:' do |file_name, file_conten
|
|
31
31
|
step %(a file named "#{file_name}" with mode "0755" and with:), file_content
|
32
32
|
end
|
33
33
|
|
34
|
-
|
35
|
-
step '(a/the) file (named) "([^"]*)" with "([^"]*)"' do |file_name, file_content|
|
34
|
+
step '(a/the) file (named) ":file_name" with ":file_content"' do |file_name, file_content|
|
36
35
|
write_file(file_name, unescape_text(file_content))
|
37
36
|
end
|
38
|
-
=end
|
39
37
|
|
40
38
|
step '(a/the) file (named) ":file_name" with mode ":file_mode" and with:' do |file_name, file_mode, file_content|
|
41
39
|
write_file(file_name, unescape_text(file_content))
|
@@ -1,3 +1,8 @@
|
|
1
|
+
require "aruba/api/text"
|
2
|
+
require "aruba/turnip/text"
|
3
|
+
include Aruba::Api::Text
|
4
|
+
include Aruba::Turnip::Text
|
5
|
+
|
1
6
|
placeholder :channel do
|
2
7
|
match /(output|stderr|stdout)/ do |channel|
|
3
8
|
channel
|
@@ -10,6 +15,16 @@ placeholder :command do
|
|
10
15
|
end
|
11
16
|
end
|
12
17
|
|
18
|
+
placeholder :text do
|
19
|
+
match /'(.*)'/ do |text|
|
20
|
+
unescape_control_codes(unescape_text(text))
|
21
|
+
end
|
22
|
+
|
23
|
+
match /"(.*)"/ do |text|
|
24
|
+
unescape_control_codes(unescape_text(text))
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
13
28
|
placeholder :with_optional_timeout do
|
14
29
|
match /\sfor up to (\d+) seconds?/ do |seconds|
|
15
30
|
seconds.to_i
|
data/lib/aruba/turnip/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aruba-turnip
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joe Yates
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aruba
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '3'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: simplecov
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: turnip
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -102,9 +116,11 @@ files:
|
|
102
116
|
- bin/setup
|
103
117
|
- lib/aruba/turnip.rb
|
104
118
|
- lib/aruba/turnip/command.rb
|
119
|
+
- lib/aruba/turnip/environment.rb
|
105
120
|
- lib/aruba/turnip/file.rb
|
106
121
|
- lib/aruba/turnip/placeholders.rb
|
107
122
|
- lib/aruba/turnip/testing_frameworks.rb
|
123
|
+
- lib/aruba/turnip/text.rb
|
108
124
|
- lib/aruba/turnip/version.rb
|
109
125
|
- spec/acceptance/fixtures/cli-app/.rspec
|
110
126
|
- spec/acceptance/fixtures/cli-app/README.md
|
@@ -126,6 +142,7 @@ files:
|
|
126
142
|
- spec/acceptance/testing_frameworks/turnip/steps/filesystem/create_directory.feature
|
127
143
|
- spec/aruba/turnip_spec.rb
|
128
144
|
- spec/spec_helper.rb
|
145
|
+
- spec/support/simplecov.rb
|
129
146
|
- spec/turnip_helper.rb
|
130
147
|
homepage: https://github.com/joeyates/aruba-turnip
|
131
148
|
licenses:
|