forked from Rohde-Schwarz/sparrow
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
36 lines (28 loc) · 740 Bytes
/
Rakefile
File metadata and controls
36 lines (28 loc) · 740 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
require "bundler/gem_tasks"
require "rspec/core/rake_task"
RSpec::Core::RakeTask.new(:spec)
RAILS_VERSIONS = [
"3.2.21",
"4.0.13"
]
def run_tests_for_version(version)
commands = []
commands << "rm Gemfile.lock"
commands << "gem install rails -v #{version}"
commands << "bundle install"
commands << "bundle exec rspec"
system({'RAILS_VERSION' => version}, commands.join(';'))
end
task :all do
RAILS_VERSIONS.each do |version|
puts "Testing gem for rails version: #{version}"
success = run_tests_for_version(version)
if not success
puts "Test suite aborted, errors occured."
exit($?.exitstatus)
end
end
end
task :default do
run_tests_for_version(ENV['RAILS_VERSION'] || '3.2.21')
end