Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

a couple of attributes specs

  • Loading branch information...
commit 4f23c2e26510b5f799e15cd5bd5397d86e57a939 1 parent 088e859
@infused authored
Showing with 15 additions and 0 deletions.
  1. +15 −0 spec/dbf/record_spec.rb
View
15 spec/dbf/record_spec.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.