Skip to content

Commit

Permalink
Couple of reasonable specs for Munger::Data.new
Browse files Browse the repository at this point in the history
NOTE: Could we test yield self better?

Signed-off-by: Scott Chacon <[email protected]>
  • Loading branch information
bitbckt authored and schacon committed Dec 16, 2008
1 parent 661c281 commit 1aff464
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions spec/munger/data/new_spec.rb
Original file line number Diff line number Diff line change
@@ -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.