aruba 0.14.5 → 0.14.6
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.
- checksums.yaml +4 -4
- data/History.md +6 -0
- data/features/steps/environment/disable_bunder.feature +18 -0
- data/lib/aruba/api.rb +2 -0
- data/lib/aruba/api/bundler.rb +16 -0
- data/lib/aruba/api/rvm.rb +0 -7
- data/lib/aruba/matchers/deprecated.rb +1 -0
- data/lib/aruba/matchers/deprecated/file.rb +15 -0
- data/lib/aruba/matchers/file/have_same_file_content.rb +5 -5
- data/lib/aruba/version.rb +1 -1
- data/spec/aruba/api/bundler_spec.rb +15 -0
- data/spec/aruba/matchers/deprecated_spec.rb +82 -0
- data/spec/aruba/matchers/file_spec.rb +82 -0
- metadata +8 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 36afa2404b1af00e5c354bab122b797efe0b76b081968ba2ef7a2d4e28766023
|
4
|
+
data.tar.gz: 22cede1491c8f912f3d10595f0456421d11810752129ea25813eaf92f1406d4c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 172bbd209a8e61f153329e96cfd48fa5d43f09a6886392eea1ea32bd42d85eb8b81a384a94eb9817a02c8c79add61f1357481b302f5ebea579d0f5f8711331af
|
7
|
+
data.tar.gz: 3cb4616934fa7fb2f1e554d6dc11ff3f42d34c72d8c83064211f70c2153333979c8cccd7e57e402cda779839e99c2080567f3443c09703259cbebdfacbb8e7b4
|
data/History.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# RELEASED
|
2
2
|
|
3
|
+
## [v0.14.6](https://github.com/cucumber/aruba/compare/v0.14.5...v0.14.6)
|
4
|
+
|
5
|
+
* Document and fix `@disable-bundler` hook (#561)
|
6
|
+
* Deprecate `have_same_file_content_like` and `a_file_with_same_content_like`
|
7
|
+
in favor of `have_same_file_content_as` and `a_file_with_same_content_as` (#557)
|
8
|
+
|
3
9
|
## [v0.14.5](https://github.com/cucumber/aruba/compare/v0.14.4...v0.14.5)
|
4
10
|
|
5
11
|
* Loosen dependency on child_process (#551)
|
@@ -0,0 +1,18 @@
|
|
1
|
+
Feature: Disable Bundler environment
|
2
|
+
Use the @disable-bundler tag to escape from your project's Gemfile.
|
3
|
+
|
4
|
+
Background:
|
5
|
+
Given I use the fixture "cli-app"
|
6
|
+
|
7
|
+
Scenario: Clear the Bundler environment
|
8
|
+
|
9
|
+
Given a file named "features/run.feature" with:
|
10
|
+
"""
|
11
|
+
Feature: My Feature
|
12
|
+
@disable-bundler
|
13
|
+
Scenario: Check environment
|
14
|
+
When I run `env`
|
15
|
+
Then the output should not match /^BUNDLE_GEMFILE=/
|
16
|
+
"""
|
17
|
+
When I run `cucumber`
|
18
|
+
Then the features should all pass
|
data/lib/aruba/api.rb
CHANGED
@@ -15,6 +15,7 @@ end
|
|
15
15
|
require 'aruba/api/environment'
|
16
16
|
require 'aruba/api/filesystem'
|
17
17
|
require 'aruba/api/text'
|
18
|
+
require 'aruba/api/bundler'
|
18
19
|
require 'aruba/api/rvm'
|
19
20
|
|
20
21
|
Aruba.platform.require_matching_files('../matchers/**/*.rb', __FILE__)
|
@@ -27,6 +28,7 @@ module Aruba
|
|
27
28
|
include Aruba::Api::Commands
|
28
29
|
include Aruba::Api::Environment
|
29
30
|
include Aruba::Api::Filesystem
|
31
|
+
include Aruba::Api::Bundler
|
30
32
|
include Aruba::Api::Rvm
|
31
33
|
include Aruba::Api::Deprecated
|
32
34
|
include Aruba::Api::Text
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'aruba/api/environment'
|
2
|
+
|
3
|
+
module Aruba
|
4
|
+
module Api
|
5
|
+
module Bundler
|
6
|
+
include Environment
|
7
|
+
|
8
|
+
# Unset variables used by bundler
|
9
|
+
def unset_bundler_env_vars
|
10
|
+
%w[RUBYOPT BUNDLE_PATH BUNDLE_BIN_PATH BUNDLE_GEMFILE].each do |key|
|
11
|
+
delete_environment_variable(key)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
data/lib/aruba/api/rvm.rb
CHANGED
@@ -32,13 +32,6 @@ module Aruba
|
|
32
32
|
raise "I didn't understand rvm's output: #{all_stdout}"
|
33
33
|
end
|
34
34
|
end
|
35
|
-
|
36
|
-
# Unset variables used by bundler
|
37
|
-
def unset_bundler_env_vars
|
38
|
-
%w[RUBYOPT BUNDLE_PATH BUNDLE_BIN_PATH BUNDLE_GEMFILE].each do |key|
|
39
|
-
set_environment_variable(key, nil)
|
40
|
-
end
|
41
|
-
end
|
42
35
|
end
|
43
36
|
end
|
44
37
|
end
|
@@ -0,0 +1 @@
|
|
1
|
+
Aruba.platform.require_matching_files('../deprecated/**/*.rb', __FILE__)
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module RSpec
|
2
|
+
module Matchers
|
3
|
+
def have_same_file_content_like(expected)
|
4
|
+
RSpec.deprecate('`have_same_file_content_like`', :replacement => '`have_same_file_content_as`')
|
5
|
+
|
6
|
+
have_same_file_content_as(expected)
|
7
|
+
end
|
8
|
+
|
9
|
+
def a_file_with_same_content_like(expected)
|
10
|
+
RSpec.deprecate('`a_file_with_same_content_like`', :replacement => '`a_file_with_same_content_as`')
|
11
|
+
|
12
|
+
a_file_with_same_content_as(expected)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -2,7 +2,7 @@ require 'rspec/expectations/version'
|
|
2
2
|
|
3
3
|
require 'fileutils'
|
4
4
|
|
5
|
-
# @!method
|
5
|
+
# @!method have_same_file_content_as(file_name)
|
6
6
|
# This matchers checks if <file1> has the same content like <file2>
|
7
7
|
#
|
8
8
|
# @param [String] file_name
|
@@ -19,10 +19,10 @@ require 'fileutils'
|
|
19
19
|
# @example Use matcher
|
20
20
|
#
|
21
21
|
# RSpec.describe do
|
22
|
-
# it { expect(file1).to
|
23
|
-
# it { expect(files).to include
|
22
|
+
# it { expect(file1).to have_same_file_content_as(file2) }
|
23
|
+
# it { expect(files).to include a_file_with_same_content_as(file2) }
|
24
24
|
# end
|
25
|
-
RSpec::Matchers.define :
|
25
|
+
RSpec::Matchers.define :have_same_file_content_as do |expected|
|
26
26
|
match do |actual|
|
27
27
|
stop_all_commands
|
28
28
|
|
@@ -44,5 +44,5 @@ RSpec::Matchers.define :have_same_file_content_like do |expected|
|
|
44
44
|
end
|
45
45
|
|
46
46
|
if RSpec::Expectations::Version::STRING >= '3.0'
|
47
|
-
RSpec::Matchers.alias_matcher :
|
47
|
+
RSpec::Matchers.alias_matcher :a_file_with_same_content_as, :have_same_file_content_as
|
48
48
|
end
|
data/lib/aruba/version.rb
CHANGED
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'aruba/api'
|
3
|
+
|
4
|
+
RSpec.describe Aruba::Api::Bundler do
|
5
|
+
include_context 'uses aruba API'
|
6
|
+
|
7
|
+
describe '#unset_bundler_env_vars' do
|
8
|
+
it "sets up Aruba's environment to clear Bundler's variables" do
|
9
|
+
@aruba.unset_bundler_env_vars
|
10
|
+
|
11
|
+
expect(@aruba.aruba.environment['BUNDLE_PATH']).to be_nil
|
12
|
+
expect(@aruba.aruba.environment['BUNDLE_GEMFILE']).to be_nil
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -36,4 +36,86 @@ RSpec.describe 'Deprecated matchers' do
|
|
36
36
|
end
|
37
37
|
end
|
38
38
|
end
|
39
|
+
|
40
|
+
describe "to have_same_file_content_like" do
|
41
|
+
let(:file_name) { @file_name }
|
42
|
+
let(:file_path) { @file_path }
|
43
|
+
|
44
|
+
let(:reference_file) { 'fixture' }
|
45
|
+
|
46
|
+
before :each do
|
47
|
+
@aruba.write_file(@file_name, "foo bar baz")
|
48
|
+
@aruba.write_file(reference_file, reference_file_content)
|
49
|
+
end
|
50
|
+
|
51
|
+
context 'when files are the same' do
|
52
|
+
let(:reference_file_content) { 'foo bar baz' }
|
53
|
+
|
54
|
+
context 'and this is expected' do
|
55
|
+
it { expect(file_name).to have_same_file_content_like reference_file }
|
56
|
+
end
|
57
|
+
|
58
|
+
context 'and this is not expected' do
|
59
|
+
it do
|
60
|
+
expect { expect(file_name).not_to have_same_file_content_like reference_file }.to raise_error RSpec::Expectations::ExpectationNotMetError
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
context 'when files are not the same' do
|
66
|
+
let(:reference_file_content) { 'bar' }
|
67
|
+
|
68
|
+
context 'and this is expected' do
|
69
|
+
it { expect(file_name).not_to have_same_file_content_like reference_file }
|
70
|
+
end
|
71
|
+
|
72
|
+
context 'and this is not expected' do
|
73
|
+
it do
|
74
|
+
expect { expect(file_name).to have_same_file_content_like reference_file }.to raise_error RSpec::Expectations::ExpectationNotMetError
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
describe "include a_file_with_same_content_like" do
|
81
|
+
let(:reference_file) { 'fixture' }
|
82
|
+
let(:reference_file_content) { 'foo bar baz' }
|
83
|
+
let(:file_with_same_content) { 'file_a.txt' }
|
84
|
+
let(:file_with_different_content) { 'file_b.txt' }
|
85
|
+
|
86
|
+
before :each do
|
87
|
+
@aruba.write_file(file_with_same_content, reference_file_content)
|
88
|
+
@aruba.write_file(reference_file, reference_file_content)
|
89
|
+
@aruba.write_file(file_with_different_content, 'Some different content here...')
|
90
|
+
end
|
91
|
+
|
92
|
+
context 'when the array of files includes a file with the same content' do
|
93
|
+
let(:files) { [file_with_different_content, file_with_same_content] }
|
94
|
+
|
95
|
+
context 'and this is expected' do
|
96
|
+
it { expect(files).to include a_file_with_same_content_like reference_file }
|
97
|
+
end
|
98
|
+
|
99
|
+
context 'and this is not expected' do
|
100
|
+
it do
|
101
|
+
expect { expect(files).not_to include a_file_with_same_content_like reference_file }.to raise_error RSpec::Expectations::ExpectationNotMetError
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
end
|
106
|
+
|
107
|
+
context 'when the array of files does not include a file with the same content' do
|
108
|
+
let(:files) { [file_with_different_content] }
|
109
|
+
|
110
|
+
context 'and this is expected' do
|
111
|
+
it { expect(files).not_to include a_file_with_same_content_like reference_file }
|
112
|
+
end
|
113
|
+
|
114
|
+
context 'and this is not expected' do
|
115
|
+
it do
|
116
|
+
expect { expect(files).to include a_file_with_same_content_like reference_file }.to raise_error RSpec::Expectations::ExpectationNotMetError
|
117
|
+
end
|
118
|
+
end
|
119
|
+
end
|
120
|
+
end
|
39
121
|
end
|
@@ -124,4 +124,86 @@ RSpec.describe 'File Matchers' do
|
|
124
124
|
it { expect(@file_name).not_to have_file_size(0) }
|
125
125
|
end
|
126
126
|
end
|
127
|
+
|
128
|
+
describe "to have_same_file_content_as" do
|
129
|
+
let(:file_name) { @file_name }
|
130
|
+
let(:file_path) { @file_path }
|
131
|
+
|
132
|
+
let(:reference_file) { 'fixture' }
|
133
|
+
|
134
|
+
before :each do
|
135
|
+
@aruba.write_file(@file_name, "foo bar baz")
|
136
|
+
@aruba.write_file(reference_file, reference_file_content)
|
137
|
+
end
|
138
|
+
|
139
|
+
context 'when files are the same' do
|
140
|
+
let(:reference_file_content) { 'foo bar baz' }
|
141
|
+
|
142
|
+
context 'and this is expected' do
|
143
|
+
it { expect(file_name).to have_same_file_content_as reference_file }
|
144
|
+
end
|
145
|
+
|
146
|
+
context 'and this is not expected' do
|
147
|
+
it do
|
148
|
+
expect { expect(file_name).not_to have_same_file_content_as reference_file }.to raise_error RSpec::Expectations::ExpectationNotMetError
|
149
|
+
end
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
153
|
+
context 'when files are not the same' do
|
154
|
+
let(:reference_file_content) { 'bar' }
|
155
|
+
|
156
|
+
context 'and this is expected' do
|
157
|
+
it { expect(file_name).not_to have_same_file_content_as reference_file }
|
158
|
+
end
|
159
|
+
|
160
|
+
context 'and this is not expected' do
|
161
|
+
it do
|
162
|
+
expect { expect(file_name).to have_same_file_content_as reference_file }.to raise_error RSpec::Expectations::ExpectationNotMetError
|
163
|
+
end
|
164
|
+
end
|
165
|
+
end
|
166
|
+
end
|
167
|
+
|
168
|
+
describe "include a_file_with_same_content_as" do
|
169
|
+
let(:reference_file) { 'fixture' }
|
170
|
+
let(:reference_file_content) { 'foo bar baz' }
|
171
|
+
let(:file_with_same_content) { 'file_a.txt' }
|
172
|
+
let(:file_with_different_content) { 'file_b.txt' }
|
173
|
+
|
174
|
+
before :each do
|
175
|
+
@aruba.write_file(file_with_same_content, reference_file_content)
|
176
|
+
@aruba.write_file(reference_file, reference_file_content)
|
177
|
+
@aruba.write_file(file_with_different_content, 'Some different content here...')
|
178
|
+
end
|
179
|
+
|
180
|
+
context 'when the array of files includes a file with the same content' do
|
181
|
+
let(:files) { [file_with_different_content, file_with_same_content] }
|
182
|
+
|
183
|
+
context 'and this is expected' do
|
184
|
+
it { expect(files).to include a_file_with_same_content_as reference_file }
|
185
|
+
end
|
186
|
+
|
187
|
+
context 'and this is not expected' do
|
188
|
+
it do
|
189
|
+
expect { expect(files).not_to include a_file_with_same_content_as reference_file }
|
190
|
+
end
|
191
|
+
end
|
192
|
+
|
193
|
+
end
|
194
|
+
|
195
|
+
context 'when the array of files does not include a file with the same content' do
|
196
|
+
let(:files) { [file_with_different_content] }
|
197
|
+
|
198
|
+
context 'and this is expected' do
|
199
|
+
it { expect(files).not_to include a_file_with_same_content_as reference_file }
|
200
|
+
end
|
201
|
+
|
202
|
+
context 'and this is not expected' do
|
203
|
+
it do
|
204
|
+
expect { expect(files).to include a_file_with_same_content_as reference_file }
|
205
|
+
end
|
206
|
+
end
|
207
|
+
end
|
208
|
+
end
|
127
209
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aruba
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.14.
|
4
|
+
version: 0.14.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aslak Hellesøy
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
|
-
date: 2018-
|
16
|
+
date: 2018-06-29 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: cucumber
|
@@ -233,6 +233,7 @@ files:
|
|
233
233
|
- features/steps/command/stop.feature
|
234
234
|
- features/steps/core/announce.feature
|
235
235
|
- features/steps/environment/append_environment_variable.feature
|
236
|
+
- features/steps/environment/disable_bunder.feature
|
236
237
|
- features/steps/environment/home_variable.feature
|
237
238
|
- features/steps/environment/prepend_environment_variable.feature
|
238
239
|
- features/steps/environment/set_environment_variable.feature
|
@@ -288,6 +289,7 @@ files:
|
|
288
289
|
- fixtures/spawn_process/stderr.sh
|
289
290
|
- lib/aruba.rb
|
290
291
|
- lib/aruba/api.rb
|
292
|
+
- lib/aruba/api/bundler.rb
|
291
293
|
- lib/aruba/api/command.rb
|
292
294
|
- lib/aruba/api/core.rb
|
293
295
|
- lib/aruba/api/deprecated.rb
|
@@ -343,6 +345,8 @@ files:
|
|
343
345
|
- lib/aruba/matchers/command/have_output_on_stderr.rb
|
344
346
|
- lib/aruba/matchers/command/have_output_on_stdout.rb
|
345
347
|
- lib/aruba/matchers/command/have_output_size.rb
|
348
|
+
- lib/aruba/matchers/deprecated.rb
|
349
|
+
- lib/aruba/matchers/deprecated/file.rb
|
346
350
|
- lib/aruba/matchers/directory.rb
|
347
351
|
- lib/aruba/matchers/directory/be_an_existing_directory.rb
|
348
352
|
- lib/aruba/matchers/directory/have_sub_directory.rb
|
@@ -398,6 +402,7 @@ files:
|
|
398
402
|
- script/bootstrap
|
399
403
|
- script/console
|
400
404
|
- script/test
|
405
|
+
- spec/aruba/api/bundler_spec.rb
|
401
406
|
- spec/aruba/api/deprecated_spec.rb
|
402
407
|
- spec/aruba/api/environment/restore_env_spec.rb
|
403
408
|
- spec/aruba/api/environment/set_env_spec.rb
|
@@ -484,5 +489,5 @@ rubyforge_project:
|
|
484
489
|
rubygems_version: 2.7.6
|
485
490
|
signing_key:
|
486
491
|
specification_version: 4
|
487
|
-
summary: aruba-0.14.
|
492
|
+
summary: aruba-0.14.6
|
488
493
|
test_files: []
|