Permalink
Browse files

Add spec for Virtus::Attribute::DefaultValue::FromCallable.handle?

  • Loading branch information...
1 parent 7320971 commit 56fa1793ce803f0825800ac8567b8a1c589048fb @solnic committed Mar 15, 2012
@@ -1,5 +1,20 @@
require 'spec_helper'
-describe Virtus::Attribute::DefaultValue::FromCallable, '.handle' do
- it 'should have spec'
+describe Virtus::Attribute::DefaultValue::FromCallable, '.handle?' do
+ subject { described_class.handle?(attribute, default) }
+
+ let(:attribute) { mock('attribute') }
+
+ context 'with a callable' do
+ let(:default) { Proc.new {} }
+
+ it { should be(true) }
+ end
+
+ context 'with a non-callable' do
+ let(:default) { '' }
+
+ it { should be(false) }
+ end
end
+

0 comments on commit 56fa179

Please sign in to comment.