Skip to content

Commit

Permalink
a couple of attributes specs
Browse files Browse the repository at this point in the history
  • Loading branch information
infused committed Aug 7, 2012
1 parent 088e859 commit 4f23c2e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions spec/dbf/record_spec.rb
Expand Up @@ -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.