From 33790e63ff0bfd58fd820fc4d1d72d8ac4dbcdd6 Mon Sep 17 00:00:00 2001 From: Michael Dvorkin Date: Tue, 8 Oct 2013 15:26:29 -0700 Subject: [PATCH] Fixed ActiveRecord 4.0 specs --- spec/ext/active_record_spec.rb | 295 ++++++++++++++++++++++++++++++++- 1 file changed, 293 insertions(+), 2 deletions(-) diff --git a/spec/ext/active_record_spec.rb b/spec/ext/active_record_spec.rb index 74a3654..83fbe63 100644 --- a/spec/ext/active_record_spec.rb +++ b/spec/ext/active_record_spec.rb @@ -118,7 +118,105 @@ EOS # ActiveRecord 3.1 and on. #-------------------------------------------------------------------------- - if ActiveRecord::VERSION::STRING >= "3.1" + if ActiveRecord::VERSION::STRING >= "4.0" + str = <<-EOS.strip +# #, + "created_at" => #, + "id" => #, + "name" => #, + "rank" => # + }, + @destroyed = false, + @marked_for_destruction = false, + @new_record = true, + @previously_changed = {}, + @readonly = false, + @reflects_state = [ + [0] false + ], + @transaction_state = nil, + @txn = nil, + attr_accessor :attributes = { + "admin" => false, + "created_at" => "1992-10-10 12:30:00", + "id" => nil, + :id => nil, + "name" => "Diana", + "rank" => 1 + }, + attr_accessor :destroyed_by_association = nil, + attr_reader :association_cache = {}, + attr_reader :changed_attributes = { + "admin" => nil, + "created_at" => nil, + "name" => nil, + "rank" => nil + } +> +EOS + # ActiveRecord 3.1 and on. + #-------------------------------------------------------------------------- + elsif ActiveRecord::VERSION::STRING >= "3.1" str = <<-EOS.strip #= "3.1" str = <<-EOS.strip +[ + [0] # #, + "created_at" => #, + "id" => #, + "name" => #, + "rank" => # + }, + @destroyed = false, + @marked_for_destruction = false, + @new_record = true, + @previously_changed = {}, + @readonly = false, + @reflects_state = [ + [0] false + ], + @transaction_state = nil, + @txn = nil, + attr_accessor :attributes = { + "admin" => false, + "created_at" => "1992-10-10 12:30:00", + "id" => nil, + :id => nil, + "name" => "Diana", + "rank" => 1 + }, + attr_accessor :destroyed_by_association = nil, + attr_reader :association_cache = {}, + attr_reader :changed_attributes = { + "admin" => nil, + "created_at" => nil, + "name" => nil, + "rank" => nil + } + >, + [1] # #, + "created_at" => #, + "id" => #, + "name" => #, + "rank" => # + }, + @destroyed = false, + @marked_for_destruction = false, + @new_record = true, + @previously_changed = {}, + @readonly = false, + @reflects_state = [ + [0] false + ], + @transaction_state = nil, + @txn = nil, + attr_accessor :attributes = { + "admin" => true, + "created_at" => "2003-05-26 14:15:00", + "id" => nil, + :id => nil, + "name" => "Laura", + "rank" => 2 + }, + attr_accessor :destroyed_by_association = nil, + attr_reader :association_cache = {}, + attr_reader :changed_attributes = { + "admin" => nil, + "created_at" => nil, + "name" => nil, + "rank" => nil + } + > +] +EOS + # ActiveRecord 3.1 and on. + #-------------------------------------------------------------------------- + elsif ActiveRecord::VERSION::STRING >= "3.1" + str = <<-EOS.strip [ [0] #