Skip to content

Instantly share code, notes, and snippets.

@marten
Created September 26, 2014 09:27
Show Gist options
  • Save marten/5e6c8f5e7a0aabe506b2 to your computer and use it in GitHub Desktop.
Save marten/5e6c8f5e7a0aabe506b2 to your computer and use it in GitHub Desktop.

To see it fail:

BUNDLE_GEMFILE=Gemfile-214 bundle install
BUNDLE_GEMFILE=Gemfile-299 bundle install

BUNDLE_GEMFILE=Gemfile-214 bundle exec rspec serialization_spec.rb
=> passes
BUNDLE_GEMFILE=Gemfile-299 bundle exec rspec serialization_spec.rb
=> fails
source 'https://rubygems.org'
gem 'sqlite3'
gem 'rspec', '2.14'
gem 'activerecord'
GEM
remote: https://rubygems.org/
specs:
activemodel (4.1.6)
activesupport (= 4.1.6)
builder (~> 3.1)
activerecord (4.1.6)
activemodel (= 4.1.6)
activesupport (= 4.1.6)
arel (~> 5.0.0)
activesupport (4.1.6)
i18n (~> 0.6, >= 0.6.9)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.1)
tzinfo (~> 1.1)
arel (5.0.1.20140414130214)
builder (3.2.2)
diff-lcs (1.2.5)
i18n (0.6.11)
json (1.8.1)
minitest (5.4.1)
rspec (2.14.0)
rspec-core (~> 2.14.0)
rspec-expectations (~> 2.14.0)
rspec-mocks (~> 2.14.0)
rspec-core (2.14.8)
rspec-expectations (2.14.5)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.14.6)
sqlite3 (1.3.9)
thread_safe (0.3.4)
tzinfo (1.2.2)
thread_safe (~> 0.1)
PLATFORMS
ruby
DEPENDENCIES
activerecord
rspec (= 2.14)
sqlite3
source 'https://rubygems.org'
gem 'sqlite3'
gem 'rspec', '2.99'
gem 'activerecord'
GEM
remote: https://rubygems.org/
specs:
activemodel (4.1.6)
activesupport (= 4.1.6)
builder (~> 3.1)
activerecord (4.1.6)
activemodel (= 4.1.6)
activesupport (= 4.1.6)
arel (~> 5.0.0)
activesupport (4.1.6)
i18n (~> 0.6, >= 0.6.9)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.1)
tzinfo (~> 1.1)
arel (5.0.1.20140414130214)
builder (3.2.2)
diff-lcs (1.2.5)
i18n (0.6.11)
json (1.8.1)
minitest (5.4.1)
rspec (2.99.0)
rspec-core (~> 2.99.0)
rspec-expectations (~> 2.99.0)
rspec-mocks (~> 2.99.0)
rspec-core (2.99.2)
rspec-expectations (2.99.2)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.99.2)
sqlite3 (1.3.9)
thread_safe (0.3.4)
tzinfo (1.2.2)
thread_safe (~> 0.1)
PLATFORMS
ruby
DEPENDENCIES
activerecord
rspec (= 2.99)
sqlite3
require 'active_record'
require 'sqlite3'
ActiveRecord::Base.establish_connection adapter: 'sqlite3', database: ':memory:'
ActiveRecord::Schema.define do
create_table :things, force: true do |t|
t.text :something_hash
end
end
class Thing < ActiveRecord::Base
serialize :something_hash
end
describe 'serializing doubles' do
it 'works' do
something = double("something")
Thing.create! something_hash: something
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment