146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
|
# File 'lib/aruba/initializer.rb', line 146
def create_helper
file = 'test/test_helper.rb'
creator = if File.exist? file
:append_to_file
else
:create_file
end
send creator, file, <<-EOS
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
if RUBY_VERSION < '1.9.3'
::Dir.glob(::File.expand_path('../support/*.rb', __FILE__)).each { |f| require File.join(File.dirname(f), File.basename(f, '.rb')) }
::Dir.glob(::File.expand_path('../support/**/*.rb', __FILE__)).each { |f| require File.join(File.dirname(f), File.basename(f, '.rb')) }
else
::Dir.glob(::File.expand_path('../support/*.rb', __FILE__)).each { |f| require_relative f }
::Dir.glob(::File.expand_path('../support/**/*.rb', __FILE__)).each { |f| require_relative f }
end
EOS
end
|