Permalink
Browse files

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

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

0 comments on commit eeb6418

Please sign in to comment.