Skip to content

Commit 2834de2

Browse files
committedSep 3, 2014
[MODEL] Added auxiliary Rake task for integration tests, run against 3 and 4 gemfiles
With the refactored tests, we have to provide a specific BUNDLE_GEMFILE for integration tests, so added a wrapper Rake task, which sets it up and runs the auxiliary task. The interface for the end user stays the same, they just run: $ bundle exec rake test:integration
1 parent 2379fc9 commit 2834de2

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed
 

‎Rakefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ namespace :test do
6969
#
7070
puts '-'*80
7171
sh "cd #{__current__.join('elasticsearch-model')} && unset BUNDLE_GEMFILE &&" +
72-
%Q| #{ ENV['TEST_BUNDLE_GEMFILE'] ? "BUNDLE_GEMFILE=#{ENV['TEST_BUNDLE_GEMFILE']}" : '' }| +
72+
%Q| #{ ENV['TEST_BUNDLE_GEMFILE'] ? "BUNDLE_GEMFILE='#{ENV['TEST_BUNDLE_GEMFILE']}'" : '' }| +
7373
" bundle exec rake test:integration"
7474
puts "\n"
7575

‎elasticsearch-model/Rakefile

+7-1
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,18 @@ namespace :test do
2222
# test.warning = true
2323
end
2424

25-
Rake::TestTask.new(:integration) do |test|
25+
Rake::TestTask.new(:run_integration) do |test|
2626
Rake::Task['test:ci_reporter'].invoke if ENV['CI']
2727
test.libs << 'lib' << 'test'
2828
test.test_files = FileList["test/integration/**/*_test.rb"]
2929
end
3030

31+
desc "Run integration tests against ActiveModel 3 and 4"
32+
task :integration do
33+
sh "BUNDLE_GEMFILE='#{File.expand_path('../gemfiles/3.0.gemfile', __FILE__)}' bundle exec rake test:run_integration"
34+
sh "BUNDLE_GEMFILE='#{File.expand_path('../gemfiles/4.0.gemfile', __FILE__)}' bundle exec rake test:run_integration"
35+
end
36+
3137
Rake::TestTask.new(:all) do |test|
3238
Rake::Task['test:ci_reporter'].invoke if ENV['CI']
3339
test.libs << 'lib' << 'test'

0 commit comments

Comments
 (0)
Please sign in to comment.