aruba 0.7.4 → 0.8.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.nav +12 -0
- data/.rspec +1 -0
- data/.rubocop.yml +12 -0
- data/.simplecov +2 -0
- data/.travis.yml +5 -6
- data/Gemfile +53 -26
- data/History.md +17 -0
- data/LICENSE +1 -1
- data/README.md +45 -19
- data/Rakefile +12 -2
- data/TODO.md +3 -0
- data/aruba.gemspec +19 -8
- data/cucumber.yml +1 -1
- data/features/api/cd.feature +119 -0
- data/features/api/command/run.feature +37 -0
- data/features/api/command/which.feature +37 -0
- data/features/api/environment/append_environment_variable.feature +118 -0
- data/features/api/environment/prepend_environment_variable.feature +118 -0
- data/features/api/environment/set_environment_variable.feature +252 -0
- data/features/configuration/exit_timeout.feature +51 -0
- data/features/configuration/fixtures_directories.feature +31 -0
- data/features/configuration/fixtures_path_prefix.feature +24 -0
- data/features/configuration/io_timeout.feature +31 -0
- data/features/configuration/keep_ansi.feature +31 -0
- data/features/configuration/root_directory.feature +31 -0
- data/features/configuration/working_directory.feature +32 -0
- data/features/fixtures/cli-app/.gitignore +9 -0
- data/features/fixtures/cli-app/.rspec +2 -0
- data/features/fixtures/cli-app/README.md +34 -0
- data/features/fixtures/cli-app/Rakefile +1 -0
- data/features/fixtures/cli-app/bin/cli +6 -0
- data/features/fixtures/cli-app/cli-app.gemspec +26 -0
- data/features/fixtures/cli-app/features/support/env.rb +1 -0
- data/features/fixtures/cli-app/lib/cli/app.rb +13 -0
- data/features/fixtures/cli-app/lib/cli/app/version.rb +5 -0
- data/features/fixtures/cli-app/script/console +14 -0
- data/features/fixtures/cli-app/spec/cli/app_spec.rb +7 -0
- data/features/fixtures/cli-app/spec/spec_helper.rb +10 -0
- data/features/fixtures/copy/file.txt +1 -1
- data/features/hooks/after/command.feature +34 -0
- data/features/hooks/before/command.feature +61 -0
- data/features/matchers/directory/have_sub_directory.feature +110 -0
- data/features/matchers/file/be_existing_file.feature +82 -0
- data/features/matchers/file/have_file_content.feature +123 -0
- data/features/matchers/file/have_file_size.feature +107 -0
- data/features/matchers/path/be_an_absolute_path.feature +74 -0
- data/features/matchers/path/be_an_existing_path.feature +97 -0
- data/features/matchers/path/have_permissions.feature +118 -0
- data/features/matchers/timeouts.feature +48 -0
- data/features/step_definitions/aruba_dev_steps.rb +69 -1
- data/features/steps/commands/exit_statuses.feature +136 -0
- data/features/steps/commands/in_process.feature +129 -0
- data/features/steps/commands/run.feature +36 -0
- data/features/steps/environment/home_variable.feature +49 -0
- data/features/steps/environment/set_environment_variable.feature +34 -0
- data/features/support/aruba.rb +5 -0
- data/features/support/env.rb +8 -4
- data/lib/aruba.rb +20 -8
- data/lib/aruba/announcer.rb +1 -0
- data/lib/aruba/api.rb +18 -1179
- data/lib/aruba/api/command.rb +351 -0
- data/lib/aruba/api/core.rb +141 -0
- data/lib/aruba/api/deprecated.rb +549 -0
- data/lib/aruba/api/environment.rb +61 -0
- data/lib/aruba/api/filesystem.rb +305 -0
- data/lib/aruba/api/rvm.rb +39 -0
- data/lib/aruba/aruba_path.rb +75 -0
- data/lib/aruba/basic_configuration.rb +208 -0
- data/lib/aruba/basic_configuration/option.rb +25 -0
- data/lib/aruba/config.rb +43 -30
- data/lib/aruba/config/jruby.rb +14 -0
- data/lib/aruba/config_wrapper.rb +17 -0
- data/lib/aruba/contracts/relative_path.rb +13 -0
- data/lib/aruba/creators/aruba_file_creator.rb +32 -0
- data/lib/aruba/creators/aruba_fixed_size_file_creator.rb +32 -0
- data/lib/aruba/cucumber.rb +87 -53
- data/lib/aruba/cucumber/hooks.rb +65 -10
- data/lib/aruba/environment.rb +121 -0
- data/lib/aruba/errors.rb +3 -0
- data/lib/aruba/extensions/string/strip.rb +24 -0
- data/lib/aruba/hooks.rb +54 -0
- data/lib/aruba/jruby.rb +4 -9
- data/lib/aruba/matchers/command.rb +1 -79
- data/lib/aruba/matchers/command/be_successfully_executed.rb +30 -0
- data/lib/aruba/matchers/command/have_exit_status.rb +47 -0
- data/lib/aruba/matchers/command/have_finished_in_time.rb +42 -0
- data/lib/aruba/matchers/directory.rb +1 -59
- data/lib/aruba/matchers/directory/be_an_existing_directory.rb +34 -0
- data/lib/aruba/matchers/directory/have_sub_directory.rb +49 -0
- data/lib/aruba/matchers/file.rb +1 -177
- data/lib/aruba/matchers/file/be_an_existing_file.rb +34 -0
- data/lib/aruba/matchers/file/have_file_content.rb +58 -0
- data/lib/aruba/matchers/file/have_file_size.rb +43 -0
- data/lib/aruba/matchers/file/have_same_file_content.rb +44 -0
- data/lib/aruba/matchers/path.rb +1 -99
- data/lib/aruba/matchers/path/a_path_matching_pattern.rb +21 -0
- data/lib/aruba/matchers/path/be_an_absolute_path.rb +32 -0
- data/lib/aruba/matchers/path/be_an_existing_path.rb +33 -0
- data/lib/aruba/matchers/path/have_permissions.rb +60 -0
- data/lib/aruba/matchers/path/match_path_pattern.rb +41 -0
- data/lib/aruba/matchers/rspec.rb +0 -0
- data/lib/aruba/matchers/rspec_matcher_include_regexp.rb +1 -1
- data/lib/aruba/platform.rb +230 -0
- data/lib/aruba/process_monitor.rb +23 -5
- data/lib/aruba/processes/basic_process.rb +35 -1
- data/lib/aruba/processes/debug_process.rb +26 -15
- data/lib/aruba/processes/in_process.rb +21 -9
- data/lib/aruba/processes/spawn_process.rb +29 -19
- data/lib/aruba/reporting.rb +2 -0
- data/lib/aruba/rspec.rb +61 -13
- data/lib/aruba/runtime.rb +33 -0
- data/script/bootstrap +4 -6
- data/spec/aruba/api/runtime_spec.rb +28 -0
- data/spec/aruba/api_spec.rb +129 -126
- data/spec/aruba/aruba_path_spec.rb +65 -0
- data/spec/aruba/basic_configuration_spec.rb +5 -0
- data/spec/aruba/config_wrapper_spec.rb +25 -0
- data/spec/aruba/configuration_spec.rb +5 -0
- data/spec/aruba/jruby_spec.rb +34 -18
- data/spec/aruba/matchers/directory_spec.rb +6 -7
- data/spec/aruba/matchers/file_spec.rb +16 -20
- data/spec/aruba/matchers/path_spec.rb +14 -11
- data/spec/aruba/rspec_spec.rb +15 -0
- data/spec/aruba/runtime_spec.rb +29 -0
- data/spec/aruba/spawn_process_spec.rb +2 -2
- data/spec/spec_helper.rb +10 -2
- data/spec/support/configs/rspec.rb +1 -1
- data/spec/support/matchers/option.rb +35 -0
- data/spec/support/shared_contexts/aruba.rb +10 -8
- data/spec/support/shared_examples/configuration.rb +116 -0
- metadata +182 -33
- data/.rvmrc +0 -1
- data/features/before_cmd_hooks.feature +0 -61
- data/features/command_environment_variables.feature +0 -31
- data/features/custom_ruby_process.feature +0 -12
- data/features/exit_statuses.feature +0 -30
- data/features/support/custom_main.rb +0 -28
- data/lib/aruba/matchers/mode.rb +0 -52
- data/lib/aruba/utils.rb +0 -21
@@ -0,0 +1,65 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'aruba/aruba_path'
|
3
|
+
|
4
|
+
RSpec.describe Aruba::ArubaPath do
|
5
|
+
subject(:path) { described_class.new(new_path) }
|
6
|
+
|
7
|
+
let(:new_path) { 'path/to/dir' }
|
8
|
+
|
9
|
+
it { expect(path).to be }
|
10
|
+
|
11
|
+
describe '#to_s' do
|
12
|
+
end
|
13
|
+
|
14
|
+
describe '#to_s' do
|
15
|
+
context 'when string is used' do
|
16
|
+
it { expect(path.to_s).to eq new_path }
|
17
|
+
end
|
18
|
+
|
19
|
+
# make it compatible with the old API
|
20
|
+
context 'when array is used' do
|
21
|
+
let(:net_path) { %w(path to dir) }
|
22
|
+
|
23
|
+
it { expect(path.to_s).to eq File.join(*new_path) }
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
describe '#push' do
|
28
|
+
before(:each) { path.push 'subdir' }
|
29
|
+
|
30
|
+
it { expect(path.to_s).to eq 'path/to/dir/subdir' }
|
31
|
+
end
|
32
|
+
|
33
|
+
describe '#<<' do
|
34
|
+
before(:each) { path << 'subdir' }
|
35
|
+
|
36
|
+
it { expect(path.to_s).to eq 'path/to/dir/subdir' }
|
37
|
+
end
|
38
|
+
|
39
|
+
describe '#pop' do
|
40
|
+
before(:each) { path.pop }
|
41
|
+
|
42
|
+
it { expect(path.to_s).to eq 'path/to' }
|
43
|
+
end
|
44
|
+
|
45
|
+
describe '#relative?' do
|
46
|
+
context 'when is relative' do
|
47
|
+
it { expect(path).to be_relative }
|
48
|
+
end
|
49
|
+
|
50
|
+
context 'when is absolute' do
|
51
|
+
let(:new_path) { '/absolute/path' }
|
52
|
+
it { expect(path).not_to be_relative }
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
describe '#[]' do
|
57
|
+
context 'when single index' do
|
58
|
+
it { expect(path[0]).to eq 'p' }
|
59
|
+
end
|
60
|
+
|
61
|
+
context 'when range' do
|
62
|
+
it { expect(path[0..1]).to eq 'pa' }
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe Aruba::ConfigWrapper do
|
4
|
+
subject(:wrapper) { described_class.new(config) }
|
5
|
+
|
6
|
+
let(:config) { {} }
|
7
|
+
|
8
|
+
context 'when option is defined' do
|
9
|
+
before :each do
|
10
|
+
config[:opt] = true
|
11
|
+
end
|
12
|
+
|
13
|
+
context 'when valid' do
|
14
|
+
it { expect(wrapper.opt).to be true }
|
15
|
+
end
|
16
|
+
|
17
|
+
context 'when one tries to pass arguments to option' do
|
18
|
+
it { expect{ wrapper.opt('arg') }.to raise_error ArgumentError, 'Options take no argument' }
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
context 'when option is not defined' do
|
23
|
+
it { expect{ wrapper.opt }.to raise_error ArgumentError, 'Option "opt" is unknown. Please use only earlier defined options' }
|
24
|
+
end
|
25
|
+
end
|
data/spec/aruba/jruby_spec.rb
CHANGED
@@ -1,39 +1,55 @@
|
|
1
1
|
require 'spec_helper'
|
2
|
-
require 'aruba/config'
|
3
2
|
require 'aruba/api'
|
4
3
|
|
5
4
|
describe "Aruba JRuby Startup Helper" do
|
6
5
|
before(:all) do
|
7
6
|
@fake_env = ENV.clone
|
8
7
|
end
|
9
|
-
before(:each) do
|
10
|
-
Aruba.config = Aruba::Config.new
|
11
8
|
|
9
|
+
before :each do
|
10
|
+
Aruba.config.reset
|
11
|
+
|
12
|
+
# Define before_cmd-hook
|
13
|
+
load 'aruba/config/jruby.rb'
|
14
|
+
end
|
15
|
+
|
16
|
+
before(:each) do
|
12
17
|
@fake_env['JRUBY_OPTS'] = "--1.9"
|
13
18
|
@fake_env['JAVA_OPTS'] = "-Xdebug"
|
14
19
|
|
15
20
|
stub_const('ENV', @fake_env)
|
16
21
|
end
|
17
22
|
|
18
|
-
|
19
|
-
|
23
|
+
context 'when some mri ruby' do
|
24
|
+
before :each do
|
25
|
+
stub_const('RUBY_PLATFORM', 'x86_64-chocolate')
|
26
|
+
end
|
27
|
+
|
28
|
+
before :each do
|
29
|
+
Aruba.config.before :command, self
|
30
|
+
end
|
20
31
|
|
21
|
-
|
22
|
-
|
23
|
-
expect(ENV['JRUBY_OPTS']).to eq "--1.9"
|
24
|
-
expect(ENV['JAVA_OPTS']).to eq "-Xdebug"
|
32
|
+
it { expect(ENV['JRUBY_OPTS']).to eq '--1.9' }
|
33
|
+
it { expect(ENV['JAVA_OPTS']).to eq '-Xdebug' }
|
25
34
|
end
|
26
35
|
|
27
|
-
|
28
|
-
|
36
|
+
context 'when jruby ruby' do
|
37
|
+
before :each do
|
38
|
+
stub_const('RUBY_PLATFORM', 'java')
|
39
|
+
end
|
40
|
+
|
41
|
+
before :each do
|
42
|
+
rb_config = double('rb_config')
|
43
|
+
allow(rb_config).to receive(:[]).and_return('solaris')
|
44
|
+
|
45
|
+
stub_const 'RbConfig::CONFIG', rb_config
|
46
|
+
end
|
29
47
|
|
30
|
-
|
31
|
-
|
32
|
-
|
48
|
+
before :each do
|
49
|
+
Aruba.config.before :command, self
|
50
|
+
end
|
33
51
|
|
34
|
-
|
35
|
-
|
36
|
-
expect(ENV['JRUBY_OPTS']).to eq "-X-C --1.9"
|
37
|
-
expect(ENV['JAVA_OPTS']).to eq "-d32 -Xdebug"
|
52
|
+
it { expect(ENV['JRUBY_OPTS']).to eq '-X-C --1.9' }
|
53
|
+
it { expect(ENV['JAVA_OPTS']).to eq '-d32 -Xdebug' }
|
38
54
|
end
|
39
55
|
end
|
@@ -1,13 +1,12 @@
|
|
1
1
|
require 'spec_helper'
|
2
|
+
require 'aruba/matchers/directory'
|
3
|
+
require 'fileutils'
|
2
4
|
|
3
5
|
RSpec.describe 'Directory Matchers' do
|
4
6
|
include_context 'uses aruba API'
|
7
|
+
include_context 'needs to expand paths'
|
5
8
|
|
6
|
-
|
7
|
-
@aruba.expand_path(*args)
|
8
|
-
end
|
9
|
-
|
10
|
-
describe 'to_be_existing_directory' do
|
9
|
+
describe 'to_be_an_existing_directory' do
|
11
10
|
let(:name) { 'test.d' }
|
12
11
|
let(:path) { File.join(@aruba.current_directory, name) }
|
13
12
|
|
@@ -16,11 +15,11 @@ RSpec.describe 'Directory Matchers' do
|
|
16
15
|
FileUtils.mkdir_p path
|
17
16
|
end
|
18
17
|
|
19
|
-
it { expect(name).to
|
18
|
+
it { expect(name).to be_an_existing_directory }
|
20
19
|
end
|
21
20
|
|
22
21
|
context 'when directory does not exist' do
|
23
|
-
it { expect(name).not_to
|
22
|
+
it { expect(name).not_to be_an_existing_directory }
|
24
23
|
end
|
25
24
|
end
|
26
25
|
|
@@ -1,48 +1,44 @@
|
|
1
1
|
require 'spec_helper'
|
2
|
+
require 'aruba/matchers/file'
|
2
3
|
|
3
4
|
RSpec.describe 'File Matchers' do
|
4
5
|
include_context 'uses aruba API'
|
5
6
|
include_context 'needs to expand paths'
|
6
7
|
|
7
|
-
describe '
|
8
|
+
describe 'to_be_an_existing_file' do
|
8
9
|
let(:name) { @file_name }
|
9
10
|
|
10
11
|
context 'when file exists' do
|
11
12
|
before(:each) { create_test_files(name) }
|
12
13
|
|
13
|
-
it { expect(name).to
|
14
|
+
it { expect(name).to be_an_existing_file }
|
14
15
|
end
|
15
16
|
|
16
17
|
context 'when file does not exist' do
|
17
|
-
it { expect(name).not_to
|
18
|
+
it { expect(name).not_to be_an_existing_file }
|
18
19
|
end
|
19
|
-
end
|
20
|
-
|
21
|
-
describe 'to_be_existing_files' do
|
22
|
-
let(:name) { %w(file1.txt file2.txt) }
|
23
20
|
|
24
|
-
context 'when
|
25
|
-
|
21
|
+
context 'when contains ~' do
|
22
|
+
let(:name) { File.join('~', random_string) }
|
26
23
|
|
27
|
-
|
28
|
-
|
24
|
+
before(:each) do
|
25
|
+
@aruba.with_environment 'HOME' => expand_path('.') do
|
26
|
+
create_test_files(name)
|
27
|
+
end
|
29
28
|
end
|
30
29
|
|
31
|
-
|
32
|
-
|
33
|
-
|
30
|
+
it do
|
31
|
+
@aruba.with_environment 'HOME' => expand_path('.') do
|
32
|
+
expect(name).to be_an_existing_file
|
33
|
+
end
|
34
34
|
end
|
35
35
|
end
|
36
|
-
|
37
|
-
context 'when file does not exist' do
|
38
|
-
it { expect(name).not_to be_existing_files }
|
39
|
-
end
|
40
36
|
end
|
41
37
|
|
42
38
|
describe 'to_have_file_content' do
|
43
39
|
context 'when file exists' do
|
44
40
|
before :each do
|
45
|
-
|
41
|
+
Aruba::Platform.write_file(@file_path, 'aba')
|
46
42
|
end
|
47
43
|
|
48
44
|
context 'and file content is exactly equal string ' do
|
@@ -112,7 +108,7 @@ RSpec.describe 'File Matchers' do
|
|
112
108
|
describe 'to_have_file_size' do
|
113
109
|
context 'when file exists' do
|
114
110
|
before :each do
|
115
|
-
|
111
|
+
Aruba::Platform.write_file(@file_path, '')
|
116
112
|
end
|
117
113
|
|
118
114
|
context 'and file size is equal' do
|
@@ -1,5 +1,8 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
+
require 'fileutils'
|
4
|
+
require 'aruba/matchers/path'
|
5
|
+
|
3
6
|
RSpec.describe 'Path Matchers' do
|
4
7
|
include_context 'uses aruba API'
|
5
8
|
|
@@ -11,7 +14,7 @@ RSpec.describe 'Path Matchers' do
|
|
11
14
|
context 'when pattern is string' do
|
12
15
|
context 'when there is file which matches path pattern' do
|
13
16
|
before :each do
|
14
|
-
|
17
|
+
Aruba::Platform.write_file(@file_path, '')
|
15
18
|
end
|
16
19
|
|
17
20
|
it { expect(all_paths).to match_path_pattern(expand_path(@file_name)) }
|
@@ -25,7 +28,7 @@ RSpec.describe 'Path Matchers' do
|
|
25
28
|
context 'when pattern is regex' do
|
26
29
|
context 'when there is file which matches path pattern' do
|
27
30
|
before :each do
|
28
|
-
|
31
|
+
Aruba::Platform.write_file(@file_path, '')
|
29
32
|
end
|
30
33
|
|
31
34
|
it { expect(all_paths).to match_path_pattern(/test/) }
|
@@ -37,31 +40,31 @@ RSpec.describe 'Path Matchers' do
|
|
37
40
|
end
|
38
41
|
end
|
39
42
|
|
40
|
-
describe '
|
43
|
+
describe 'to_be_an_absolute_path' do
|
41
44
|
let(:name) { @file_name }
|
42
45
|
let(:path) { File.expand_path(File.join(@aruba.current_directory, name)) }
|
43
46
|
|
44
47
|
context 'when is absolute path' do
|
45
|
-
it { expect(path).to
|
48
|
+
it { expect(path).to be_an_absolute_path }
|
46
49
|
end
|
47
50
|
|
48
51
|
context 'when is relative path' do
|
49
|
-
it { expect(name).not_to
|
52
|
+
it { expect(name).not_to be_an_absolute_path }
|
50
53
|
end
|
51
54
|
end
|
52
55
|
|
53
|
-
describe '
|
56
|
+
describe 'to_be_an_existing_path' do
|
54
57
|
context 'when file' do
|
55
58
|
context 'exists' do
|
56
59
|
before :each do
|
57
|
-
|
60
|
+
Aruba::Platform.write_file(@file_path, '')
|
58
61
|
end
|
59
62
|
|
60
|
-
it { expect(@file_name).to
|
63
|
+
it { expect(@file_name).to be_an_existing_path }
|
61
64
|
end
|
62
65
|
|
63
66
|
context 'does not exist' do
|
64
|
-
it { expect(@file_name).not_to
|
67
|
+
it { expect(@file_name).not_to be_an_existing_path }
|
65
68
|
end
|
66
69
|
end
|
67
70
|
|
@@ -74,11 +77,11 @@ RSpec.describe 'Path Matchers' do
|
|
74
77
|
FileUtils.mkdir_p path
|
75
78
|
end
|
76
79
|
|
77
|
-
it { expect(name).to
|
80
|
+
it { expect(name).to be_an_existing_path }
|
78
81
|
end
|
79
82
|
|
80
83
|
context 'does not exist' do
|
81
|
-
it { expect(name).not_to
|
84
|
+
it { expect(name).not_to be_an_existing_path }
|
82
85
|
end
|
83
86
|
end
|
84
87
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe 'RSpec Integration', :type => :aruba do
|
4
|
+
describe 'Configuration' do
|
5
|
+
subject(:config) { aruba.config }
|
6
|
+
|
7
|
+
context 'when io_wait_timeout is 0.5', :io_wait_timeout => 0.5 do
|
8
|
+
it { expect(config.io_wait_timeout).to eq 0.5 }
|
9
|
+
end
|
10
|
+
|
11
|
+
context 'when io_wait_timeout is 0.1' do
|
12
|
+
it { expect(config.io_wait_timeout).to eq 0.1 }
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe Aruba::Runtime do
|
4
|
+
# describe '#fixtures_directory' do
|
5
|
+
# context 'when no fixtures directories exist' do
|
6
|
+
# it "should raise exception" do
|
7
|
+
# expect { api.fixtures_directory }.to raise_error
|
8
|
+
# end
|
9
|
+
# end
|
10
|
+
#
|
11
|
+
# context 'when "/features/fixtures"-directory exist' do
|
12
|
+
# before(:each) { api.create_directory('features/fixtures') }
|
13
|
+
#
|
14
|
+
# it { expect(api.fixtures_directory).to eq expand_path('features/fixtures') }
|
15
|
+
# end
|
16
|
+
#
|
17
|
+
# context 'when "/spec/fixtures"-directory exist' do
|
18
|
+
# before(:each) { api.create_directory('spec/fixtures') }
|
19
|
+
#
|
20
|
+
# it { expect(api.fixtures_directory).to eq expand_path('spec/fixtures') }
|
21
|
+
# end
|
22
|
+
#
|
23
|
+
# context 'when "/test/fixtures"-directory exist' do
|
24
|
+
# before(:each) { api.create_directory('test/fixtures') }
|
25
|
+
#
|
26
|
+
# it { expect(api.fixtures_directory.to_s).to eq expand_path('test/fixtures') }
|
27
|
+
# end
|
28
|
+
# end
|
29
|
+
end
|
@@ -35,13 +35,13 @@ RSpec.describe Aruba::Processes::SpawnProcess do
|
|
35
35
|
end
|
36
36
|
|
37
37
|
describe "#stop" do
|
38
|
-
let(:reader) {
|
38
|
+
let(:reader) { instance_double('Aruba::Announcer') }
|
39
39
|
|
40
40
|
before(:each) { process.run! }
|
41
41
|
|
42
42
|
before :each do
|
43
|
-
allow(reader).to receive(:announce).with(:stderr, '')
|
44
43
|
expect(reader).to receive(:announce).with(:stdout, "yo\n")
|
44
|
+
allow(reader).to receive(:announce)
|
45
45
|
end
|
46
46
|
|
47
47
|
context 'when stopped successfully' do
|
data/spec/spec_helper.rb
CHANGED
@@ -10,9 +10,17 @@ SimpleCov.start
|
|
10
10
|
require 'bundler'
|
11
11
|
Bundler.require
|
12
12
|
|
13
|
+
# Activate RSpec Integration
|
14
|
+
require 'aruba/rspec'
|
15
|
+
|
13
16
|
# Loading support files
|
14
|
-
|
15
|
-
Dir.glob(::File.expand_path('../support
|
17
|
+
if RUBY_VERSION < '1.9'
|
18
|
+
Dir.glob(::File.expand_path('../support/*.rb', __FILE__)).each { |f| require File.join(File.dirname(f), File.basename(f, '.rb')) }
|
19
|
+
Dir.glob(::File.expand_path('../support/**/*.rb', __FILE__)).each { |f| require File.join(File.dirname(f), File.basename(f, '.rb')) }
|
20
|
+
else
|
21
|
+
Dir.glob(::File.expand_path('../support/*.rb', __FILE__)).each { |f| require_relative f }
|
22
|
+
Dir.glob(::File.expand_path('../support/**/*.rb', __FILE__)).each { |f| require_relative f }
|
23
|
+
end
|
16
24
|
|
17
25
|
# Avoid writing "describe LocalPac::MyClass do [..]" but "describe MyClass do [..]"
|
18
26
|
include Aruba
|