Permalink
Browse files

Couple of reasonable specs for Munger::Data.new

NOTE: Could we test yield self better?

Signed-off-by: Scott Chacon <schacon@gmail.com>
  • Loading branch information...
1 parent 661c281 commit 1aff4640421ad0c3a05ae731b3beef57e5cfe7cc @bitbckt bitbckt committed with Sep 18, 2008
Showing with 18 additions and 0 deletions.
  1. +18 −0 spec/munger/data/new_spec.rb
@@ -0,0 +1,18 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe Munger::Data do
+
+ describe '.new' do
+
+ it 'initializes the data attribute to the :data value' do
+ data = [{:foo => '1'}, {:foo => 2}]
+ Munger::Data.new(:data => data).data.should == data
+ end
+
+ it 'yields itself to the given block' do
+ Munger::Data.new { |data| data.should be_kind_of(Munger::Data) }
+ end
+
+ end
+
+end

0 comments on commit 1aff464

Please sign in to comment.