Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit eeb6418a6297c3a984b205f3b28b63ff8300a49e 1 parent 56fa179
@solnic authored
View
19 spec/unit/virtus/attribute/default_value/from_clonable/class_methods/handle_spec.rb
@@ -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
+
Please sign in to comment.
Something went wrong with that request. Please try again.