Commit 6487913

mo khan <mo@mokhan.ca>
2013-07-21 00:15:46
add specs for default data row mapper
1 parent 8b74491
spec/unit/default_data_row_mapper_spec.rb
@@ -0,0 +1,24 @@
+require "spec_helper"
+class Book
+  attr_reader :id, :name
+
+  def initialize(attributes)
+    @id = attributes[:id]
+    @name = attributes[:name]
+  end
+end
+
+describe Humble::DefaultDataRowMapper do
+  let(:sut) { Humble::DefaultDataRowMapper.new(configuration) }
+  let(:configuration) { { :type => Book } }
+
+  let(:result) { sut.map_from({:id => 1, :name => 'blah'}) }
+
+  it "should map the id" do
+    result.id.should == 1
+  end
+
+  it "should map the name" do
+    result.name.should == "blah"
+  end
+end
Gemfile.lock
@@ -1,7 +1,7 @@
 PATH
   remote: .
   specs:
-    humble (0.0.1374365339)
+    humble (0.0.1374365736)
       sequel
 
 GEM