Sha256: 944633bd6b3c19dcee0d56934ad313abb225614d14365e83e5c3c0ab19341088

Contents?: true

Size: 793 Bytes

Versions: 35

Compression:

Stored size: 793 Bytes

Contents

require File.dirname(__FILE__) + '/spec_helper'

module ObjectTests
	class User < RedisObject
		use_store :global
	end
	class Thingy < RedisObject
		
	end
	class Doodad < RedisObject
		
	end
end

describe RedisObject do
	
	it "can reconnect to redis" do
		RedisObject.reconnect!
		RedisObject.store.reconnect!
	end
	
	it "can dump to a file" do
		obj = ObjectTests::User.create("test")
		RedisObject.dump_stores_to_files("/tmp")
		RedisObject.store.flushdb
	end
	
	it "can restore from a file" do
		RedisObject.restore_stores_from_files("/tmp")
		ObjectTests::User.find("test").should be_a(ObjectTests::User)
	end
	
	it "can get all stores" do
		RedisObject.stores.count.should eq(1)
	end
	
	it "can reset stores" do
		RedisObject.stores.each do |(name,store)|
			store.reset
		end
	end
	
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
redis_object-1.5.1 spec/adapter_spec.rb
redis_object-1.5.0 spec/adapter_spec.rb
redis_object-1.4.9 spec/adapter_spec.rb
redis_object-1.4.8 spec/adapter_spec.rb
redis_object-1.4.7 spec/adapter_spec.rb
redis_object-1.4.6 spec/adapter_spec.rb
redis_object-1.4.5 spec/adapter_spec.rb
redis_object-1.4.3 spec/adapter_spec.rb
redis_object-1.4.2 spec/adapter_spec.rb
redis_object-1.4.1 spec/adapter_spec.rb
redis_object-1.4.0 spec/adapter_spec.rb
redis_object-1.3.9 spec/adapter_spec.rb
redis_object-1.3.8 spec/adapter_spec.rb
redis_object-1.3.7 spec/adapter_spec.rb
redis_object-1.3.6 spec/adapter_spec.rb
redis_object-1.3.5 spec/adapter_spec.rb
redis_object-1.3.4 spec/adapter_spec.rb
redis_object-1.3.3 spec/adapter_spec.rb
redis_object-1.3.2 spec/adapter_spec.rb
redis_object-1.3.1b spec/adapter_spec.rb