Skip to content

Commit

Permalink
fix some specs on ruby, but also normalize the output of a method for…
Browse files Browse the repository at this point in the history
… mri
  • Loading branch information
joshk committed Aug 9, 2012
1 parent 0382e80 commit 5049bec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/travis/model/repository.rb
Expand Up @@ -85,7 +85,7 @@ def counts_by_owner_names(owner_names)
query = %(SELECT owner_name, count(*) FROM repositories WHERE owner_name IN (?) GROUP BY owner_name)
query = sanitize_sql([query, owner_names])
rows = connection.select_all(query, owner_names)
Hash[*rows.map { |row| row.values }.flatten]
Hash[*rows.map { |row| [row['owner_name'], row['count'].to_i] }.flatten]
end
end

Expand Down
2 changes: 1 addition & 1 deletion spec/travis/model/repository_spec.rb
Expand Up @@ -104,7 +104,7 @@

it 'returns repository counts per owner_name for the given owner_names' do
counts = Repository.counts_by_owner_names(%w(svenfuchs travis-ci))
counts.should == { 'svenfuchs' => '1', 'travis-ci' => '1' }
counts.should == { 'svenfuchs' => 1, 'travis-ci' => 1 }
end
end
end
Expand Down

0 comments on commit 5049bec

Please sign in to comment.