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.
Files changed (141) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.nav +12 -0
  4. data/.rspec +1 -0
  5. data/.rubocop.yml +12 -0
  6. data/.simplecov +2 -0
  7. data/.travis.yml +5 -6
  8. data/Gemfile +53 -26
  9. data/History.md +17 -0
  10. data/LICENSE +1 -1
  11. data/README.md +45 -19
  12. data/Rakefile +12 -2
  13. data/TODO.md +3 -0
  14. data/aruba.gemspec +19 -8
  15. data/cucumber.yml +1 -1
  16. data/features/api/cd.feature +119 -0
  17. data/features/api/command/run.feature +37 -0
  18. data/features/api/command/which.feature +37 -0
  19. data/features/api/environment/append_environment_variable.feature +118 -0
  20. data/features/api/environment/prepend_environment_variable.feature +118 -0
  21. data/features/api/environment/set_environment_variable.feature +252 -0
  22. data/features/configuration/exit_timeout.feature +51 -0
  23. data/features/configuration/fixtures_directories.feature +31 -0
  24. data/features/configuration/fixtures_path_prefix.feature +24 -0
  25. data/features/configuration/io_timeout.feature +31 -0
  26. data/features/configuration/keep_ansi.feature +31 -0
  27. data/features/configuration/root_directory.feature +31 -0
  28. data/features/configuration/working_directory.feature +32 -0
  29. data/features/fixtures/cli-app/.gitignore +9 -0
  30. data/features/fixtures/cli-app/.rspec +2 -0
  31. data/features/fixtures/cli-app/README.md +34 -0
  32. data/features/fixtures/cli-app/Rakefile +1 -0
  33. data/features/fixtures/cli-app/bin/cli +6 -0
  34. data/features/fixtures/cli-app/cli-app.gemspec +26 -0
  35. data/features/fixtures/cli-app/features/support/env.rb +1 -0
  36. data/features/fixtures/cli-app/lib/cli/app.rb +13 -0
  37. data/features/fixtures/cli-app/lib/cli/app/version.rb +5 -0
  38. data/features/fixtures/cli-app/script/console +14 -0
  39. data/features/fixtures/cli-app/spec/cli/app_spec.rb +7 -0
  40. data/features/fixtures/cli-app/spec/spec_helper.rb +10 -0
  41. data/features/fixtures/copy/file.txt +1 -1
  42. data/features/hooks/after/command.feature +34 -0
  43. data/features/hooks/before/command.feature +61 -0
  44. data/features/matchers/directory/have_sub_directory.feature +110 -0
  45. data/features/matchers/file/be_existing_file.feature +82 -0
  46. data/features/matchers/file/have_file_content.feature +123 -0
  47. data/features/matchers/file/have_file_size.feature +107 -0
  48. data/features/matchers/path/be_an_absolute_path.feature +74 -0
  49. data/features/matchers/path/be_an_existing_path.feature +97 -0
  50. data/features/matchers/path/have_permissions.feature +118 -0
  51. data/features/matchers/timeouts.feature +48 -0
  52. data/features/step_definitions/aruba_dev_steps.rb +69 -1
  53. data/features/steps/commands/exit_statuses.feature +136 -0
  54. data/features/steps/commands/in_process.feature +129 -0
  55. data/features/steps/commands/run.feature +36 -0
  56. data/features/steps/environment/home_variable.feature +49 -0
  57. data/features/steps/environment/set_environment_variable.feature +34 -0
  58. data/features/support/aruba.rb +5 -0
  59. data/features/support/env.rb +8 -4
  60. data/lib/aruba.rb +20 -8
  61. data/lib/aruba/announcer.rb +1 -0
  62. data/lib/aruba/api.rb +18 -1179
  63. data/lib/aruba/api/command.rb +351 -0
  64. data/lib/aruba/api/core.rb +141 -0
  65. data/lib/aruba/api/deprecated.rb +549 -0
  66. data/lib/aruba/api/environment.rb +61 -0
  67. data/lib/aruba/api/filesystem.rb +305 -0
  68. data/lib/aruba/api/rvm.rb +39 -0
  69. data/lib/aruba/aruba_path.rb +75 -0
  70. data/lib/aruba/basic_configuration.rb +208 -0
  71. data/lib/aruba/basic_configuration/option.rb +25 -0
  72. data/lib/aruba/config.rb +43 -30
  73. data/lib/aruba/config/jruby.rb +14 -0
  74. data/lib/aruba/config_wrapper.rb +17 -0
  75. data/lib/aruba/contracts/relative_path.rb +13 -0
  76. data/lib/aruba/creators/aruba_file_creator.rb +32 -0
  77. data/lib/aruba/creators/aruba_fixed_size_file_creator.rb +32 -0
  78. data/lib/aruba/cucumber.rb +87 -53
  79. data/lib/aruba/cucumber/hooks.rb +65 -10
  80. data/lib/aruba/environment.rb +121 -0
  81. data/lib/aruba/errors.rb +3 -0
  82. data/lib/aruba/extensions/string/strip.rb +24 -0
  83. data/lib/aruba/hooks.rb +54 -0
  84. data/lib/aruba/jruby.rb +4 -9
  85. data/lib/aruba/matchers/command.rb +1 -79
  86. data/lib/aruba/matchers/command/be_successfully_executed.rb +30 -0
  87. data/lib/aruba/matchers/command/have_exit_status.rb +47 -0
  88. data/lib/aruba/matchers/command/have_finished_in_time.rb +42 -0
  89. data/lib/aruba/matchers/directory.rb +1 -59
  90. data/lib/aruba/matchers/directory/be_an_existing_directory.rb +34 -0
  91. data/lib/aruba/matchers/directory/have_sub_directory.rb +49 -0
  92. data/lib/aruba/matchers/file.rb +1 -177
  93. data/lib/aruba/matchers/file/be_an_existing_file.rb +34 -0
  94. data/lib/aruba/matchers/file/have_file_content.rb +58 -0
  95. data/lib/aruba/matchers/file/have_file_size.rb +43 -0
  96. data/lib/aruba/matchers/file/have_same_file_content.rb +44 -0
  97. data/lib/aruba/matchers/path.rb +1 -99
  98. data/lib/aruba/matchers/path/a_path_matching_pattern.rb +21 -0
  99. data/lib/aruba/matchers/path/be_an_absolute_path.rb +32 -0
  100. data/lib/aruba/matchers/path/be_an_existing_path.rb +33 -0
  101. data/lib/aruba/matchers/path/have_permissions.rb +60 -0
  102. data/lib/aruba/matchers/path/match_path_pattern.rb +41 -0
  103. data/lib/aruba/matchers/rspec.rb +0 -0
  104. data/lib/aruba/matchers/rspec_matcher_include_regexp.rb +1 -1
  105. data/lib/aruba/platform.rb +230 -0
  106. data/lib/aruba/process_monitor.rb +23 -5
  107. data/lib/aruba/processes/basic_process.rb +35 -1
  108. data/lib/aruba/processes/debug_process.rb +26 -15
  109. data/lib/aruba/processes/in_process.rb +21 -9
  110. data/lib/aruba/processes/spawn_process.rb +29 -19
  111. data/lib/aruba/reporting.rb +2 -0
  112. data/lib/aruba/rspec.rb +61 -13
  113. data/lib/aruba/runtime.rb +33 -0
  114. data/script/bootstrap +4 -6
  115. data/spec/aruba/api/runtime_spec.rb +28 -0
  116. data/spec/aruba/api_spec.rb +129 -126
  117. data/spec/aruba/aruba_path_spec.rb +65 -0
  118. data/spec/aruba/basic_configuration_spec.rb +5 -0
  119. data/spec/aruba/config_wrapper_spec.rb +25 -0
  120. data/spec/aruba/configuration_spec.rb +5 -0
  121. data/spec/aruba/jruby_spec.rb +34 -18
  122. data/spec/aruba/matchers/directory_spec.rb +6 -7
  123. data/spec/aruba/matchers/file_spec.rb +16 -20
  124. data/spec/aruba/matchers/path_spec.rb +14 -11
  125. data/spec/aruba/rspec_spec.rb +15 -0
  126. data/spec/aruba/runtime_spec.rb +29 -0
  127. data/spec/aruba/spawn_process_spec.rb +2 -2
  128. data/spec/spec_helper.rb +10 -2
  129. data/spec/support/configs/rspec.rb +1 -1
  130. data/spec/support/matchers/option.rb +35 -0
  131. data/spec/support/shared_contexts/aruba.rb +10 -8
  132. data/spec/support/shared_examples/configuration.rb +116 -0
  133. metadata +182 -33
  134. data/.rvmrc +0 -1
  135. data/features/before_cmd_hooks.feature +0 -61
  136. data/features/command_environment_variables.feature +0 -31
  137. data/features/custom_ruby_process.feature +0 -12
  138. data/features/exit_statuses.feature +0 -30
  139. data/features/support/custom_main.rb +0 -28
  140. data/lib/aruba/matchers/mode.rb +0 -52
  141. 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,5 @@
1
+ require 'spec_helper'
2
+
3
+ RSpec.describe Aruba::BasicConfiguration do
4
+ it_behaves_like 'a basic configuration'
5
+ 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
@@ -0,0 +1,5 @@
1
+ require 'spec_helper'
2
+
3
+ RSpec.describe Aruba::Configuration do
4
+ it_behaves_like 'a basic configuration'
5
+ end
@@ -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
- it 'configuration does not load when RUBY_PLATFORM is not java' do
19
- stub_const('RUBY_PLATFORM', 'x86_64-chocolate')
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
- load 'aruba/jruby.rb'
22
- Aruba.config.hooks.execute :before_cmd, self
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
- it 'configuration loads for java and merges existing environment variables' do
28
- stub_const('RUBY_PLATFORM', 'java')
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
- rb_config = double('rb_config')
31
- allow(rb_config).to receive(:[]).and_return('solaris')
32
- stub_const 'RbConfig::CONFIG', rb_config
48
+ before :each do
49
+ Aruba.config.before :command, self
50
+ end
33
51
 
34
- load 'aruba/jruby.rb'
35
- Aruba.config.hooks.execute :before_cmd, self
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
- def expand_path(*args)
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 be_existing_directory }
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 be_existing_directory }
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 'to_be_existing_file' do
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 be_existing_file }
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 be_existing_file }
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 files exists' do
25
- before(:each) { create_test_files(name) }
21
+ context 'when contains ~' do
22
+ let(:name) { File.join('~', random_string) }
26
23
 
27
- context 'when list of files is given' do
28
- it { expect(name).to be_existing_files }
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
- context 'when no list of files is given' do
32
- let(:name) { 'file1.txt' }
33
- it { expect(name).not_to be_existing_files }
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
- File.write(@file_path, 'aba')
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
- File.write(@file_path, '')
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
- File.write(@file_path, '')
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
- File.write(@file_path, '')
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 'to_be_absolute_path' do
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 be_absolute_path }
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 be_absolute_path }
52
+ it { expect(name).not_to be_an_absolute_path }
50
53
  end
51
54
  end
52
55
 
53
- describe 'to_be_existing_path' do
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
- File.write(@file_path, '')
60
+ Aruba::Platform.write_file(@file_path, '')
58
61
  end
59
62
 
60
- it { expect(@file_name).to be_existing_path }
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 be_existing_path }
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 be_existing_path }
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 be_existing_path }
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) { double('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
@@ -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
- Dir.glob(::File.expand_path('../support/*.rb', __FILE__)).each { |f| require_relative f }
15
- Dir.glob(::File.expand_path('../support/**/*.rb', __FILE__)).each { |f| require_relative f }
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