Browse files

skip Sequel/DataMapper specs if they can't be loaded

  • Loading branch information...
1 parent f703f88 commit 7c6c802349c04442f29516b56666466b12c3ef54 @mislav committed Jul 26, 2011
Showing with 22 additions and 8 deletions.
  1. +1 −1 Gemfile
  2. +10 −4 spec/finders/data_mapper_spec.rb
  3. +11 −3 spec/finders/sequel_spec.rb
View
2 Gemfile
@@ -7,7 +7,7 @@ gem 'rake'
gem 'activerecord', '~> 3.1.0.rc'
gem 'activeresource', '~> 3.1.0.rc'
gem 'actionpack', '~> 3.1.0.rc'
-gem 'sequel', '~> 3.8.0'
+gem 'sequel', '~> 3.8.0', :platforms => :ruby_18 # broken on 1.9
gem 'rspec', '~> 2.6.0'
gem 'mocha', '~> 0.9.8'
gem 'sqlite3', '~> 1.3.3'
View
14 spec/finders/data_mapper_spec.rb
@@ -1,8 +1,14 @@
require 'spec_helper'
-require 'will_paginate/finders/data_mapper'
-require File.expand_path('../data_mapper_test_connector', __FILE__)
-require 'will_paginate'
+begin
+ require 'will_paginate/finders/data_mapper'
+ require File.expand_path('../data_mapper_test_connector', __FILE__)
+rescue LoadError => error
+ warn "Error running DataMapper specs: #{error.message}"
+ datamapper_loaded = false
+else
+ datamapper_loaded = true
+end
describe WillPaginate::Finders::DataMapper do
@@ -59,4 +65,4 @@
end
end
-end
+end if datamapper_loaded
View
14 spec/finders/sequel_spec.rb
@@ -1,6 +1,14 @@
require 'spec_helper'
-require 'will_paginate/finders/sequel'
-require File.expand_path('../sequel_test_connector', __FILE__)
+
+begin
+ require 'will_paginate/finders/sequel'
+ require File.expand_path('../sequel_test_connector', __FILE__)
+rescue LoadError, ArgumentError => error
+ warn "Error running Sequel specs: #{error.message}"
+ sequel_loaded = false
+else
+ sequel_loaded = true
+end
describe Sequel::Dataset::Pagination, 'extension' do
@@ -50,4 +58,4 @@ class Car < Sequel::Model
end
end
-end
+end if sequel_loaded

0 comments on commit 7c6c802

Please sign in to comment.