Skip to content

Commit

Permalink
Merge pull request #39 from PerfectMemory/spec-and-compatibility-fixes
Browse files Browse the repository at this point in the history
Spec and compatibility fixes
  • Loading branch information
gkellogg committed Sep 25, 2015
2 parents 91bb748 + d6cebf3 commit 75cfd11
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 16 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ rvm:
- 1.9.3
- 2.0.0
- 2.1.0
- 2.2.0
- jruby-19mode
22 changes: 11 additions & 11 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ gem 'rake', '~> 10.0'

group :test do
gem 'coveralls', :require => false
gem 'rspec', '~> 2.14'
gem 'rdf-spec', '~> 1.1'
gem 'rspec', '~> 2.14.1'
gem 'rdf-spec', '= 1.1.3' # later version depend on rspec-its which implies rspec >= 3.0
gem 'yard', '~> 0.8'
gem 'simplecov', '~> 0.7', :require => false
gem 'redcarpet', '~> 2.2.2' unless RUBY_ENGINE == 'jruby'
gem 'guard', '~> 1.2.3'
gem 'guard-rspec', '~> 1.1.0'
gem 'guard-ctags-bundler', '~> 0.1.1'
gem 'simplecov', '~> 0.10', :require => false
gem 'redcarpet', '~> 3.2.2' unless RUBY_ENGINE == 'jruby'
gem 'guard', '~> 2.13.0'
gem 'guard-rspec', '~> 3.1.0'
gem 'guard-ctags-bundler', '~> 1.4.0'
end

group :debug do
gem "debugger", :platforms => [:mri_19, :mri_20]
gem "ruby-debug", :platforms => [:jruby]
end
#group :debug do
# gem "debugger", :platforms => [:mri_19, :mri_20]
# gem "ruby-debug", :platforms => [:jruby]
#end
14 changes: 12 additions & 2 deletions lib/spira/validations/uniqueness.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,18 @@ module Spira
module Validations
class UniquenessValidator < ActiveModel::EachValidator
# Unfortunately, we have to tie Uniqueness validators to a class.
def setup(klass)
@klass = klass
# Note: the `setup` hook has been deprecated in rails 4.1 and completely
# removed in rails 4.2; the klass is now found in #{options[:class]}.
if ActiveModel::VERSION::MAJOR <= 3 ||
(ActiveModel::VERSION::MAJOR == 4 && ActiveModel::VERSION::MINOR < 1)
def setup(klass)
@klass = klass
end
else
def initialize(options)
super
@klass = options.fetch(:class)
end
end

def validate_each(record, attribute, value)
Expand Down
4 changes: 3 additions & 1 deletion spec/enumerable_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ class ::EnumerableWithAssociationsSpec < Spira::Base
end

it "should allow other enumerables to be isomorphic to a resource" do
@enumerable_repository.statements.should be_isomorphic_with @enumerable
pending('Awaiting fix for https://github.com/ruby-rdf/rdf-isomorphic/issues/3') do
@enumerable_repository.statements.should be_isomorphic_with @enumerable
end
end
end
end
Expand Down
3 changes: 3 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
require 'rdf/spec'
require 'rdf/isomorphic'

require 'i18n'
I18n.enforce_available_locales = false

RSpec.configure do |config|
config.filter_run :focus => true
config.run_all_when_everything_filtered = true
Expand Down
4 changes: 2 additions & 2 deletions spira.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ Gem::Specification.new do |gem|
gem.add_runtime_dependency 'rdf', '~> 1.1'
gem.add_runtime_dependency 'rdf-isomorphic', '~> 1.1'
gem.add_runtime_dependency 'promise', '~> 0.3.0'
gem.add_runtime_dependency 'activemodel', '> 3.0'
gem.add_runtime_dependency 'activesupport', '> 3.0'
gem.add_runtime_dependency 'activemodel', '> 3'
gem.add_runtime_dependency 'activesupport', '> 3'

gem.post_install_message = nil
end

0 comments on commit 75cfd11

Please sign in to comment.