Skip to content
This repository has been archived by the owner on Apr 16, 2018. It is now read-only.

Commit

Permalink
register_default の spec 書いた ('ω' っ )3
Browse files Browse the repository at this point in the history
  • Loading branch information
rummelonp committed May 4, 2012
1 parent 36dbbe9 commit 03a62e0
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion spec/creepy/configration_spec.rb
Expand Up @@ -3,7 +3,7 @@
require File.join(File.dirname(__FILE__), '..', 'spec_helper')

describe Creepy::Configuration do
before(:each) do
after(:each) do
configatron.reset!
end

Expand Down Expand Up @@ -34,4 +34,29 @@
Creepy.config.hoge.should == :hoge
end
end

describe :register_default do
it 'ブロックに Creepy.config が渡されること' do
Creepy.register_default do |config|
config.should == Creepy.config
end
end

it 'ブロックで値が設定出来ること' do
Creepy.config.hoge.should be_nil
Creepy.register_default do |config|
config.hoge = :hoge
end
Creepy.config.hoge.should == :hoge
end

it 'restore_defaults 時に default が評価されること' do
dummy = lambda {}
dummy.should_receive(:call).twice
Creepy.register_default do
dummy.call
end
Creepy.reload_config!
end
end
end

0 comments on commit 03a62e0

Please sign in to comment.