Commit 6487913
Changed files (2)
spec
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