Skip to content

Commit a9be693

Browse files
author
Rafael Mendonça França
committed
Conditional test Rails 3 and Rails 4
1 parent 92d0dfa commit a9be693

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed

.travis.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,27 @@ gemfile:
1111
- test/gemfiles/Gemfile.rails-4.0.x
1212
- test/gemfiles/Gemfile.rails-4.1.x
1313

14+
env:
15+
- LEGACY=true
16+
- LEGACY=false
17+
18+
matrix:
19+
exclude:
20+
- gemfile: Gemfile
21+
env: LEGACY=true
22+
- gemfile: test/gemfiles/Gemfile.rails-4.1.x
23+
env: LEGACY=true
24+
- gemfile: test/gemfiles/Gemfile.rails-4.0.x
25+
env: LEGACY=true
26+
- gemfile: test/gemfiles/Gemfile.rails-3.0.x
27+
env: LEGACY=false
28+
- gemfile: test/gemfiles/Gemfile.rails-3.1.x
29+
env: LEGACY=false
30+
- gemfile: test/gemfiles/Gemfile.rails-3.2.x
31+
env: LEGACY=false
32+
33+
script: ./script/test
34+
1435
notifications:
1536
email: false
1637
campfire:

Rakefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ require 'bundler/gem_tasks'
44

55
task :default => :test
66

7+
task :test_legacy do
8+
exec "testrb test/test_*.rb"
9+
end
10+
711
Rake::TestTask.new(:test) do |t|
812
t.libs << 'lib'
913
t.pattern = 'test/test_*.rb'

script/test

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
set -ev
4+
5+
if [[ "${LEGACY}" != "false" ]]; then
6+
bundle exec rake test_legacy
7+
else
8+
bundle exec rake test
9+
fi

0 commit comments

Comments
 (0)