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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c68318e3bab555e2bcc2cec056fc44575b040dd4
4
- data.tar.gz: 8503e02f1933c0fb1bba89d15b7db47e5bd3d667
3
+ metadata.gz: 98df6b874f110cd2f99d1216595eba0b72a11ec5
4
+ data.tar.gz: bad8a425c428e1ab0e74d6441ee34a61073db0cd
5
5
  SHA512:
6
- metadata.gz: d0cd2b254ac61b6d33ace3c1be0589d44e41e7a3f04de6a0cd0e76d2a8c1eb18e8e9d3002de098f6ca4f158bfc75b42913ce3e78d82d6c036fb2cfd7c78b07aa
7
- data.tar.gz: ff567de60934ba6bb536cedc6f7020f351affac16ed5263b0ec0fd8a9992fc7ff4bccd737bc24814a74658437124a36d402b9942da5c72154de0ccbac3669ff7
6
+ metadata.gz: aa7f35a3442591bb7755a5090de92cf125b8644c28f5d9005748ed8da242979fd28d3429cff39758e06e8bc1ba4bb6a0d42403b1c06e8d721a60857c23733432
7
+ data.tar.gz: 50c393079c651921b15240aa9e3287fb7c86899d66b0ec178bca01f49f61465c63a744ebb0c8bfc03a69698ec15269cbca5dffbaaac940d96413b9e6f628a317
@@ -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
@@ -9,5 +9,7 @@ require "aruba/api"
9
9
 
10
10
  require "aruba/turnip/placeholders"
11
11
  require "aruba/turnip/command"
12
+ require "aruba/turnip/environment"
12
13
  require "aruba/turnip/file"
13
14
  require "aruba/turnip/testing_frameworks"
15
+ require "aruba/turnip/text"
@@ -39,14 +39,22 @@ step 'I run `([^`]*)` in background'do |cmd|
39
39
  run(sanitize_text(cmd))
40
40
  end
41
41
 
42
- step 'I type "([^"]*)"' do |input|
43
- type(unescape_text(input))
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
@@ -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
- =begin
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
@@ -0,0 +1,7 @@
1
+ module Aruba::Turnip
2
+ module Text
3
+ def unescape_control_codes(text)
4
+ text.gsub(/\\c([a-z])/) { |m| (m[2].ord - "a".ord + 1).chr }
5
+ end
6
+ end
7
+ end
@@ -1,5 +1,5 @@
1
1
  module Aruba
2
2
  module Turnip
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
@@ -1,2 +1,7 @@
1
- $LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
1
+ $LOAD_PATH.unshift File.expand_path("../lib", __dir__)
2
+
3
+ Dir.glob(::File.expand_path('support/**/*.rb', __dir__)).each do |f|
4
+ require_relative f
5
+ end
6
+
2
7
  require "aruba/turnip"
@@ -0,0 +1,5 @@
1
+ require "simplecov"
2
+
3
+ SimpleCov.start do
4
+ add_filter "/spec/"
5
+ end
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.0
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-09 00:00:00.000000000 Z
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: