Permalink
Browse files

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

  • Loading branch information...
1 parent eeb6418 commit 0074019b7510b9227c9a13133de5f4aa5cb5c8ef @solnic committed Mar 15, 2012
Showing with 17 additions and 2 deletions.
  1. +17 −2 spec/unit/virtus/attribute/default_value/from_symbol/class_methods/handle_spec.rb
@@ -1,5 +1,20 @@
require 'spec_helper'
-describe Virtus::Attribute::DefaultValue::FromSymbol, '.handle' do
- it 'should have spec'
+describe Virtus::Attribute::DefaultValue::FromSymbol, '.handle?' do
+ subject { described_class.handle?(attribute, default) }
+
+ let(:attribute) { mock('attribute') }
+
+ context 'with a symbol' do
+ let(:default) { :method_name }
+
+ it { should be(true) }
+ end
+
+ context 'with a non-symbol' do
+ let(:default) { 'method_name' }
+
+ it { should be(false) }
+ end
end
+

0 comments on commit 0074019

Please sign in to comment.