aruba-turnip 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +7 -0
- data/.rspec +4 -0
- data/.travis.yml +5 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +10 -0
- data/LICENSE.txt +21 -0
- data/README.md +55 -0
- data/Rakefile +6 -0
- data/aruba-turnip.gemspec +30 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/aruba/turnip/command.rb +379 -0
- data/lib/aruba/turnip/file.rb +223 -0
- data/lib/aruba/turnip/placeholders.rb +37 -0
- data/lib/aruba/turnip/testing_frameworks.rb +33 -0
- data/lib/aruba/turnip/version.rb +5 -0
- data/lib/aruba/turnip.rb +13 -0
- data/spec/acceptance/fixtures/cli-app/.rspec +4 -0
- data/spec/acceptance/fixtures/cli-app/README.md +39 -0
- data/spec/acceptance/fixtures/cli-app/Rakefile +1 -0
- data/spec/acceptance/fixtures/cli-app/bin/.gitkeep +0 -0
- data/spec/acceptance/fixtures/cli-app/cli-app.gemspec +26 -0
- data/spec/acceptance/fixtures/cli-app/lib/cli/app/suppress_simple_cov_output.rb +15 -0
- data/spec/acceptance/fixtures/cli-app/lib/cli/app/version.rb +5 -0
- data/spec/acceptance/fixtures/cli-app/lib/cli/app.rb +9 -0
- data/spec/acceptance/fixtures/cli-app/spec/acceptance/non-existence.feature +10 -0
- data/spec/acceptance/fixtures/cli-app/spec/acceptance/support/env.rb +0 -0
- data/spec/acceptance/fixtures/cli-app/spec/spec_helper.rb +17 -0
- data/spec/acceptance/fixtures/cli-app/spec/support/aruba.rb +1 -0
- data/spec/acceptance/fixtures/cli-app/tmp/aruba/foo/bar/example.txt +1 -0
- data/spec/acceptance/steps/aruba_dev_steps.rb +56 -0
- data/spec/acceptance/testing_frameworks/turnip/steps/command/exit_statuses.feature +136 -0
- data/spec/acceptance/testing_frameworks/turnip/steps/command/run.feature +68 -0
- data/spec/acceptance/testing_frameworks/turnip/steps/filesystem/cd_to_directory.feature +33 -0
- data/spec/acceptance/testing_frameworks/turnip/steps/filesystem/create_directory.feature +57 -0
- data/spec/aruba/turnip_spec.rb +7 -0
- data/spec/spec_helper.rb +2 -0
- data/spec/turnip_helper.rb +11 -0
- metadata +154 -0
@@ -0,0 +1,68 @@
|
|
1
|
+
Feature: Run commands
|
2
|
+
|
3
|
+
There are several steps to run commands with `aruba`.
|
4
|
+
|
5
|
+
Background:
|
6
|
+
Given I use a fixture named "cli-app"
|
7
|
+
|
8
|
+
Scenario: Run command found in path
|
9
|
+
Given an executable named "bin/aruba-test-cli" with:
|
10
|
+
"""
|
11
|
+
#!/bin/bash
|
12
|
+
exit 0
|
13
|
+
"""
|
14
|
+
And a file named "spec/acceptance/run.feature" with:
|
15
|
+
"""
|
16
|
+
Feature: Run it
|
17
|
+
Scenario: Run command
|
18
|
+
When I run `bin/aruba-test-cli`
|
19
|
+
"""
|
20
|
+
When I run `rspec`
|
21
|
+
Then the features should all pass
|
22
|
+
|
23
|
+
Scenario: Activate desired announcers when running command fails
|
24
|
+
Given an executable named "bin/aruba-test-cli" with:
|
25
|
+
"""
|
26
|
+
#!/bin/bash
|
27
|
+
echo "Hello, I'm STDOUT"
|
28
|
+
exit 1
|
29
|
+
"""
|
30
|
+
And a file named "spec/acceptance/run.feature" with:
|
31
|
+
"""
|
32
|
+
Feature: Run it
|
33
|
+
Scenario: Run command
|
34
|
+
When I successfully run `bin/aruba-test-cli`
|
35
|
+
"""
|
36
|
+
And I append to "spec/acceptance/support/env.rb" with:
|
37
|
+
"""
|
38
|
+
RSpec.configure do |config|
|
39
|
+
config.before do
|
40
|
+
aruba.config.activate_announcer_on_command_failure = [:stdout]
|
41
|
+
end
|
42
|
+
end
|
43
|
+
"""
|
44
|
+
When I run `rspec`
|
45
|
+
Then the features should not pass
|
46
|
+
And the output should contain:
|
47
|
+
"""
|
48
|
+
<<-STDOUT
|
49
|
+
Hello, I'm STDOUT
|
50
|
+
|
51
|
+
STDOUT
|
52
|
+
"""
|
53
|
+
|
54
|
+
Scenario: Run command found in "bin"-directory which is found in the current directory
|
55
|
+
Given a file named "spec/acceptance/run.feature" with:
|
56
|
+
"""
|
57
|
+
Feature: Run it
|
58
|
+
Scenario: Run command
|
59
|
+
Given an executable named "bin/local_cli" with:
|
60
|
+
\"\"\"
|
61
|
+
#!/bin/bash
|
62
|
+
exit 0
|
63
|
+
\"\"\"
|
64
|
+
And I look for executables in "bin" within the current directory
|
65
|
+
When I successfully run `local_cli`
|
66
|
+
"""
|
67
|
+
When I run `rspec`
|
68
|
+
Then the features should all pass
|
@@ -0,0 +1,33 @@
|
|
1
|
+
Feature: Change working directory
|
2
|
+
|
3
|
+
You might want to change the current working directory.
|
4
|
+
|
5
|
+
Background:
|
6
|
+
Given I use a fixture named "cli-app"
|
7
|
+
|
8
|
+
Scenario: Change to an existing sub directory
|
9
|
+
Given a file named "spec/acceptance/non-existence.feature" with:
|
10
|
+
"""
|
11
|
+
Feature: Working Directory
|
12
|
+
Scenario: Working Directory
|
13
|
+
Given a file named "foo/bar/example.txt" with:
|
14
|
+
\"\"\"
|
15
|
+
hello world
|
16
|
+
\"\"\"
|
17
|
+
When I cd to "foo/bar"
|
18
|
+
And I run `cat example.txt`
|
19
|
+
Then the output should contain "hello world"
|
20
|
+
And the file "example.txt" should exist
|
21
|
+
"""
|
22
|
+
When I run `rspec`
|
23
|
+
Then the features should all pass
|
24
|
+
|
25
|
+
Scenario: Change to an non-existing sub directory
|
26
|
+
Given a file named "spec/acceptance/non-existence.feature" with:
|
27
|
+
"""
|
28
|
+
Feature: Working Directory
|
29
|
+
Scenario: Working Directory
|
30
|
+
When I cd to "foo/bar/non-existing"
|
31
|
+
"""
|
32
|
+
When I run `rspec`
|
33
|
+
Then the features should not pass
|
@@ -0,0 +1,57 @@
|
|
1
|
+
Feature: Create Directory
|
2
|
+
|
3
|
+
As a user of aruba
|
4
|
+
I want to create directories
|
5
|
+
|
6
|
+
Background:
|
7
|
+
Given I use a fixture named "cli-app"
|
8
|
+
|
9
|
+
Scenario: Non-existing directory
|
10
|
+
Given a file named "spec/acceptance/create_directory.feature" with:
|
11
|
+
"""
|
12
|
+
Feature: Create directory
|
13
|
+
Background:
|
14
|
+
Given a directory named "dir1"
|
15
|
+
|
16
|
+
Scenario: Create directory #1
|
17
|
+
Then a directory named "dir1" should exist
|
18
|
+
|
19
|
+
Scenario: Create directory #2
|
20
|
+
Then a directory named "dir1" should exist
|
21
|
+
|
22
|
+
Scenario: Create directory #3
|
23
|
+
Then a directory named "dir1" should exist
|
24
|
+
|
25
|
+
Scenario: Create directory #4
|
26
|
+
Then a directory named "dir1" should exist
|
27
|
+
|
28
|
+
Scenario: Create directory #5
|
29
|
+
Then a directory named "dir1" should exist
|
30
|
+
"""
|
31
|
+
When I run `rspec`
|
32
|
+
Then the features should all pass
|
33
|
+
|
34
|
+
Scenario: Existing directory
|
35
|
+
|
36
|
+
It doesn't matter if a directory already exist.
|
37
|
+
|
38
|
+
Given a file named "spec/acceptance/create_directory.feature" with:
|
39
|
+
"""
|
40
|
+
Feature: Create directory
|
41
|
+
Scenario: Create directory
|
42
|
+
Given a directory named "dir1"
|
43
|
+
And a directory named "dir1"
|
44
|
+
"""
|
45
|
+
When I run `rspec`
|
46
|
+
Then the features should all pass
|
47
|
+
|
48
|
+
Scenario: Change mode along with creation of directory
|
49
|
+
Given a file named "spec/acceptance/create_directory.feature" with:
|
50
|
+
"""
|
51
|
+
Feature: Create directory
|
52
|
+
Scenario: Create directory
|
53
|
+
Given a directory named "dir1" with mode "0644"
|
54
|
+
Then the directory named "dir1" should have permissions "0644"
|
55
|
+
"""
|
56
|
+
When I run `rspec`
|
57
|
+
Then the features should all pass
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
require "aruba/turnip"
|
2
|
+
|
3
|
+
ACCEPTANCE_FIXTURES_PATH = File.join("spec", "acceptance", "fixtures")
|
4
|
+
|
5
|
+
RSpec.configure do |config|
|
6
|
+
config.include Aruba::Api
|
7
|
+
end
|
8
|
+
|
9
|
+
Aruba.configure do |config|
|
10
|
+
config.fixtures_directories = [ACCEPTANCE_FIXTURES_PATH]
|
11
|
+
end
|
metadata
ADDED
@@ -0,0 +1,154 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: aruba-turnip
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Joe Yates
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-12-09 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: aruba
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.14'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0.14'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.13'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.13'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '10.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '10.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '3'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '3'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: turnip
|
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'
|
83
|
+
description: |
|
84
|
+
This gem contains adaptations of Aruba's step definitions suitable for use
|
85
|
+
in projects tested with RSpec and Turnip.
|
86
|
+
email:
|
87
|
+
- joe.g.yates@gmail.com
|
88
|
+
executables: []
|
89
|
+
extensions: []
|
90
|
+
extra_rdoc_files: []
|
91
|
+
files:
|
92
|
+
- ".gitignore"
|
93
|
+
- ".rspec"
|
94
|
+
- ".travis.yml"
|
95
|
+
- CODE_OF_CONDUCT.md
|
96
|
+
- Gemfile
|
97
|
+
- LICENSE.txt
|
98
|
+
- README.md
|
99
|
+
- Rakefile
|
100
|
+
- aruba-turnip.gemspec
|
101
|
+
- bin/console
|
102
|
+
- bin/setup
|
103
|
+
- lib/aruba/turnip.rb
|
104
|
+
- lib/aruba/turnip/command.rb
|
105
|
+
- lib/aruba/turnip/file.rb
|
106
|
+
- lib/aruba/turnip/placeholders.rb
|
107
|
+
- lib/aruba/turnip/testing_frameworks.rb
|
108
|
+
- lib/aruba/turnip/version.rb
|
109
|
+
- spec/acceptance/fixtures/cli-app/.rspec
|
110
|
+
- spec/acceptance/fixtures/cli-app/README.md
|
111
|
+
- spec/acceptance/fixtures/cli-app/Rakefile
|
112
|
+
- spec/acceptance/fixtures/cli-app/bin/.gitkeep
|
113
|
+
- spec/acceptance/fixtures/cli-app/cli-app.gemspec
|
114
|
+
- spec/acceptance/fixtures/cli-app/lib/cli/app.rb
|
115
|
+
- spec/acceptance/fixtures/cli-app/lib/cli/app/suppress_simple_cov_output.rb
|
116
|
+
- spec/acceptance/fixtures/cli-app/lib/cli/app/version.rb
|
117
|
+
- spec/acceptance/fixtures/cli-app/spec/acceptance/non-existence.feature
|
118
|
+
- spec/acceptance/fixtures/cli-app/spec/acceptance/support/env.rb
|
119
|
+
- spec/acceptance/fixtures/cli-app/spec/spec_helper.rb
|
120
|
+
- spec/acceptance/fixtures/cli-app/spec/support/aruba.rb
|
121
|
+
- spec/acceptance/fixtures/cli-app/tmp/aruba/foo/bar/example.txt
|
122
|
+
- spec/acceptance/steps/aruba_dev_steps.rb
|
123
|
+
- spec/acceptance/testing_frameworks/turnip/steps/command/exit_statuses.feature
|
124
|
+
- spec/acceptance/testing_frameworks/turnip/steps/command/run.feature
|
125
|
+
- spec/acceptance/testing_frameworks/turnip/steps/filesystem/cd_to_directory.feature
|
126
|
+
- spec/acceptance/testing_frameworks/turnip/steps/filesystem/create_directory.feature
|
127
|
+
- spec/aruba/turnip_spec.rb
|
128
|
+
- spec/spec_helper.rb
|
129
|
+
- spec/turnip_helper.rb
|
130
|
+
homepage: https://github.com/joeyates/aruba-turnip
|
131
|
+
licenses:
|
132
|
+
- MIT
|
133
|
+
metadata: {}
|
134
|
+
post_install_message:
|
135
|
+
rdoc_options: []
|
136
|
+
require_paths:
|
137
|
+
- lib
|
138
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
139
|
+
requirements:
|
140
|
+
- - ">="
|
141
|
+
- !ruby/object:Gem::Version
|
142
|
+
version: '0'
|
143
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
144
|
+
requirements:
|
145
|
+
- - ">="
|
146
|
+
- !ruby/object:Gem::Version
|
147
|
+
version: '0'
|
148
|
+
requirements: []
|
149
|
+
rubyforge_project:
|
150
|
+
rubygems_version: 2.5.1
|
151
|
+
signing_key:
|
152
|
+
specification_version: 4
|
153
|
+
summary: Turnip step definitions for Aruba.
|
154
|
+
test_files: []
|