Skip to content

Commit

Permalink
Persistence::YAMLStore::EntityPool.root= spec: use anonymous class an…
Browse files Browse the repository at this point in the history
…d module
  • Loading branch information
chastell committed Aug 20, 2011
1 parent b22b5a0 commit b80a895
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions spec/relentity/persistence/yaml_store/entity_pool_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@ class YAMLStorePerson
describe '.root=' do

it 'stores the root dir and repoints the pool' do
module YAMLStoreRootPool; extend Persistence::YAMLStore::EntityPool; end
class YAMLStoreRootEntity; include Entity; end
entity_class = Class.new { include Entity }
pool = Module.new { extend Persistence::YAMLStore::EntityPool }
2.times do
Dir.mktmpdir do |root|
refute Pathname("#{root}/Relentity::YAMLStoreRootPool.yml").exist?
YAMLStoreRootPool.root = root
YAMLStoreRootPool << YAMLStoreRootEntity.new
assert Pathname("#{root}/Relentity::YAMLStoreRootPool.yml").exist?
Dir.mktmpdir do |tempdir|
refute Pathname("#{tempdir}/.yml").exist?
pool.root = tempdir
pool << entity_class.new
assert Pathname("#{tempdir}/.yml").exist?
end
end
end
Expand Down

0 comments on commit b80a895

Please sign in to comment.