Skip to content

Commit a7eb926

Browse files
committed
Use appraisal gem for version testing
1 parent c0ada9e commit a7eb926

File tree

8 files changed

+25
-20
lines changed

8 files changed

+25
-20
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ rvm:
33
- 2.0.0
44
- 2.1.0
55
gemfile:
6-
- gemfiles/Gemfile.rails-3.2
7-
- gemfiles/Gemfile.rails-4.0
6+
- gemfiles/rails_3_2.gemfile
7+
- gemfiles/rails_4_0.gemfile

Appraisals

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
appraise 'rails_3_2' do
2+
gem 'rails', '~> 3.2.0'
3+
end
4+
5+
appraise 'rails_4_0' do
6+
gem 'rails', '~> 4.0.0'
7+
end

Rakefile

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env rake
22
require "rake/testtask"
33
require "bundler/gem_tasks"
4+
require "appraisal"
45

56
desc "Default: run rails-secrets unit tests."
67
task :default => :test
@@ -10,11 +11,3 @@ Rake::TestTask.new do |t|
1011
t.pattern = "test/**/*_test.rb"
1112
t.warning = true
1213
end
13-
14-
task "test:all" do
15-
gemfile = File.expand_path("../Gemfile", __FILE__)
16-
17-
["rails-3.2", "rails-4.0"].each do |variant|
18-
system({"BUNDLE_GEMFILE" => "#{gemfile}.#{variant}"}, "bundle", "exec", "rake", "test")
19-
end
20-
end

gemfiles/Gemfile.rails-3.2

Lines changed: 0 additions & 5 deletions
This file was deleted.

gemfiles/Gemfile.rails-4.0

Lines changed: 0 additions & 5 deletions
This file was deleted.

gemfiles/rails_3_2.gemfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# This file was generated by Appraisal
2+
3+
source "https://rubygems.org"
4+
5+
gem "rails", "~> 3.2.0"
6+
7+
gemspec :path=>"../"

gemfiles/rails_4_0.gemfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# This file was generated by Appraisal
2+
3+
source "https://rubygems.org"
4+
5+
gem "rails", "~> 4.0.0"
6+
7+
gemspec :path=>"../"

rails-secrets.gemspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,5 @@ Gem::Specification.new do |gem|
2222
gem.required_rubygems_version = '>= 1.8.11'
2323

2424
gem.add_runtime_dependency 'rails', ['>= 3.2.0', '<= 4.1.0']
25+
gem.add_development_dependency 'appraisal', '~> 1.0'
2526
end

0 commit comments

Comments
 (0)