Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add appraisal for testing multiple versions of Rails.
- Loading branch information
1 parent
3e1a0e4
commit a5fcd74
Showing
9 changed files
with
67 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
Gemfile.lock | ||
gemfiles/*.gemfile.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,6 @@ language: ruby | |
rvm: | ||
- 2.0.0 | ||
- 2.1.1 | ||
gemfile: | ||
- gemfiles/rails_3.gemfile | ||
- gemfiles/rails_4.gemfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
appraise "rails-3" do | ||
gem "activerecord", "~> 3" | ||
gem "activesupport", "~> 3" | ||
end | ||
|
||
appraise "rails-4" do | ||
gem "activerecord", "~> 4" | ||
gem "activesupport", "~> 4" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# This file was generated by Appraisal | ||
|
||
source "https://rubygems.org" | ||
|
||
gem "activerecord", "~> 3" | ||
gem "activesupport", "~> 3" | ||
|
||
gemspec :path => "../" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# This file was generated by Appraisal | ||
|
||
source "https://rubygems.org" | ||
|
||
gem "activerecord", "~> 4" | ||
gem "activesupport", "~> 4" | ||
|
||
gemspec :path => "../" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,20 @@ | ||
RSpec::Matchers.define :have_callback do |type, name, options| | ||
match do |record| | ||
options ||= {} | ||
callbacks = record.__send__(:"_#{type}_callbacks") | ||
callbacks.any? do |callback| | ||
callback.raw_filter == name && | ||
(options[:kind].nil? || callback.kind == options[:kind]) && | ||
(options[:on].nil? || callback.options[:on] == options[:on]) | ||
return false unless callback.raw_filter == name | ||
return false unless options[:kind].nil? || callback.kind == options[:kind] | ||
return true if options[:on].nil? | ||
|
||
if callback.respond_to?(:options) | ||
options[:on] == callback.options[:on] | ||
else | ||
if_options = callback.instance_variable_get("@if") | ||
if_options.any? do |if_option| | ||
if_option =~ /#{options[:on]}/ | ||
end | ||
end | ||
end | ||
end | ||
end |