-
Notifications
You must be signed in to change notification settings - Fork 1
Query Builder and RSpec matcher #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
680ceb6 to
1bf72e4
Compare
examples/spec/query_spec.rb
Outdated
| result = connection.fetch(query) | ||
|
|
||
| aggregate_failures do | ||
| names = result.map { |row| row[:name] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jekuta Use out new awesome matcher.
|
@mknapik @jekuta Looks really nice! |
|
|
||
| let(:schema) { subject.table_schema } | ||
|
|
||
| before { connection.execute(schema.create_table_statement) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the old way for this: before { connection.create_table(schema) }
2286eda to
94c1eae
Compare
|
|
||
| def partition(hash) | ||
| partition_hash.merge!(hash) | ||
| self |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mknapik Since we do work on an instance of the query, I changed the dup.tap { |builder| #do something with the copy } into making the change and returning self. This way we can still chain the methods as before, but we skip creating new objects every time a method is called.
bdbf047 to
b4a17b0
Compare
|
|
||
| before { connection.execute(schema.create_table_statement) } | ||
|
|
||
| context 'if we have a partition' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mknapik I add a fast example on partition, but this could probably be more clear.
2a68e2c to
ebff089
Compare
* RuboCop fixes and .rubocop.yml adjustments * make query_spec example prettier * remove unused Rows * Allow to inject row hashes with symbol and string keys * immutable and mutable QueryBuilder
* test on multiple rubies
1768b89 to
470f69f
Compare
match_result_setfor expectationsrbhivefork fixes types (namespace TYPE_NAMES and require the parent file forward3d/rbhive#22)