Permalink
Browse files

some fixes to record tests

  • Loading branch information...
1 parent 05438d3 commit a6f2d6f1c9d68de4c66241b52b24b2f4d5526df8 @funny-falcon funny-falcon committed Mar 26, 2014
Showing with 10 additions and 2 deletions.
  1. +3 −0 Gemfile
  2. +1 −0 lib/tarantool/record.rb
  3. +1 −1 tarantool-record.gemspec
  4. +5 −1 test/test_record.rb
View
@@ -10,6 +10,9 @@ group :test do
gem "yajl-ruby"
gem "bson"
gem "bson_ext"
+ gem "rake"
+ gem "kgio"
+ gem "eventmachine"
end
# Specify your gem's dependencies in tarantool.gemspec
gemspec name: 'tarantool'
@@ -1,4 +1,5 @@
require 'active_model'
+require 'active_support/core_ext/hash/indifferent_access.rb'
require 'tarantool/base_record'
module Tarantool
@@ -22,5 +22,5 @@ Gem::Specification.new do |gem|
gem.require_paths = ["lib"]
gem.add_dependency "tarantool", ["~> #{Tarantool::VERSION}"]
- gem.add_dependency "activemodel", [">= 3.1", "< 4.0"]
+ gem.add_dependency "activemodel", [">= 3.1"]
end
View
@@ -83,7 +83,11 @@
it "should support AM serialization API" do
h = { login: 'prepor', name: 'Andrew', email: 'ceo@prepor.ru' }
u = user_class.create h
- u.as_json.must_equal({ 'user' => h.merge(apples_count: 0) })
+ if ActiveModel::VERSION::MAJOR >= 4
+ u.as_json.must_equal(h.merge(apples_count: 0))
+ else
+ u.as_json.must_equal({ 'user' => h.merge(apples_count: 0) })
+ end
end
end
end

0 comments on commit a6f2d6f

Please sign in to comment.