Permalink
Browse files

a couple of attributes specs

  • Loading branch information...
1 parent 088e859 commit 4f23c2e26510b5f799e15cd5bd5397d86e57a939 @infused committed Aug 7, 2012
Showing with 15 additions and 0 deletions.
  1. +15 −0 spec/dbf/record_spec.rb
View
@@ -62,4 +62,19 @@
end
end
end
+
+ describe '#attributes' do
+ let(:table) { DBF::Table.new "#{DB_PATH}/dbase_8b.dbf"}
+ let(:record) { table.find(0) }
+
+ it 'is a hash of attribute name/value pairs' do
+ record.attributes.should be_a(Hash)
+ record.attributes['CHARACTER'] == 'One'
+ end
+
+ it 'has only original field names as keys' do
+ original_field_names = %w(CHARACTER DATE FLOAT LOGICAL MEMO NUMERICAL)
+ record.attributes.keys.sort.should == original_field_names
+ end
+ end
end

0 comments on commit 4f23c2e

Please sign in to comment.