Permalink
Browse files

Tests run

  • Loading branch information...
1 parent 1c4efb4 commit 2d157d9cf04a832ecbac8109c2ab97b5a7f3f17e Nusco+Beppe committed Jul 29, 2008
Showing with 6 additions and 1 deletion.
  1. +1 −1 lib/sequel_core/adapters/ado.rb
  2. +5 −0 spec/adapters/ado_spec.rb
@@ -59,7 +59,7 @@ def fetch_rows(sql, &block)
s = @db.execute sql
@columns = s.Fields.extend(Enumerable).map do |column|
- name = column.Name.empty? ? '(no column name)' : column.Name
+ name = column.Name.empty? ? 'no column name' : column.Name
name.to_sym
end
@@ -21,6 +21,11 @@
ADO_DB.create_table!(:items) { text :name }
end
+ specify "should assign a default name to anonymous columns" do
+ col = ADO_DB.fetch('SELECT COUNT(*) FROM items').columns[0]
+ col.name.should == '(no column name)'
+ end
+
specify "should support counting" do
ADO_DB[:items] << {:name => 'my name' }
ADO_DB[:items].count.should == 1

0 comments on commit 2d157d9

Please sign in to comment.