Skip to content

Commit

Permalink
Use rbhive fork 0.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mknapik committed Apr 26, 2016
1 parent 11e04c5 commit 680ceb6
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 13 deletions.
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
source 'https://rubygems.org'

gemspec

gem 'rbhive', github: 'u2i/rbhive', tag: 'v0.7.0'
16 changes: 11 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
GIT
remote: git://github.com/u2i/rbhive.git
revision: 0d8eaa45c494e6e567f1523cacecb1786eee0508
tag: v0.7.0
specs:
rbhive (0.7.0)
json
thrift (~> 0.9)

PATH
remote: .
specs:
Expand Down Expand Up @@ -62,9 +71,6 @@ GEM
rb-fsevent (0.9.4)
rb-inotify (0.9.5)
ffi (>= 0.5.0)
rbhive (0.6.0)
json
thrift (= 0.9.0)
retryable (2.0.3)
rspec (3.4.0)
rspec-core (~> 3.4.0)
Expand Down Expand Up @@ -97,7 +103,7 @@ GEM
simplecov-html (0.10.0)
slop (3.6.0)
thor (0.19.1)
thrift (0.9.0)
thrift (0.9.3.0)
timers (4.0.1)
hitimes

Expand All @@ -112,7 +118,7 @@ DEPENDENCIES
guard-rubocop (~> 1.2)
pry
pry-byebug
rbhive (~> 0.6.0)
rbhive!
rspec (~> 3.4)
rspec-hive!
rspec-its (~> 1.2)
Expand Down
9 changes: 5 additions & 4 deletions examples/spec/query_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
query_result = connection.fetch(query)

expected_result_set = [
[a_string_matching('Wojtek'), 'Cos', a_string_matching(/3\.7.*/)]
[a_string_matching('Wojtek'), 'Cos', be_within(0.01).of(3.76)]
]

expect(query_result).to match_result_set(expected_result_set)
Expand All @@ -41,7 +41,7 @@
expected_result_set = [
{name: 'Mikolaj',
address: 'Cos',
amount: a_string_matching(/1\.2.*/)
amount: be_within(0.01).of(1.23)
}
]
expect(query_result).to match_result_set(expected_result_set)
Expand All @@ -66,9 +66,10 @@
expect(names).to contain_exactly('Michal', 'Wojtek')

result.each do |row|
expect(row[:address]).not_to be_nil
expect(row[:address]).not_to be_empty
expect(row[:address]).not_to eq('\N')
expect(row[:amount]).to match(/\d+\.\d+/)
expect(row[:amount]).not_to be_nil
expect(row[:amount]).not_to eq('\N')
end
end
#
Expand Down
2 changes: 1 addition & 1 deletion rspec-hive.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'bundler', '~> 1.7'
spec.add_development_dependency 'rspec', '~> 3.4'
spec.add_development_dependency 'rspec-its', '~> 1.2'
spec.add_development_dependency 'rbhive', '~> 0.6.0'
spec.add_development_dependency 'rbhive', '~> 0.7.0'
spec.add_development_dependency 'rubocop', '~> 0.34'
spec.add_development_dependency 'rubocop-rspec', '~> 1.3'
spec.add_development_dependency 'guard', '~> 2.6'
Expand Down
6 changes: 3 additions & 3 deletions spec/lib/rspec/hive/matchers_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
RSpec.describe 'match_result_set' do
include RSpec::Hive::QueryBuilderHelper

let(:john) { {first_name: 'John', last_name: 'Lennon'} }
let(:paul) { {first_name: 'Paul', last_name: 'McCartney'} }
let(:john) { {first_name: 'John', last_name: 'Lennon', age: 40} }
let(:paul) { {first_name: 'Paul', last_name: 'McCartney', age: 73} }

let(:full_match) { expect(actual_rows).to match_result_set(expected_rows) }
let(:partial_match) { expect(actual_rows).to match_result_set(expected_rows).partially }
Expand Down Expand Up @@ -54,7 +54,7 @@
end

context 'when the actual and expected rows are equal with rspec matchers' do
let(:expected_rows) { [[a_string_matching('John'), a_string_matching(/lennon/i)]] }
let(:expected_rows) { [[a_string_matching('John'), a_string_matching(/lennon/i), 40]] }

specify { full_match }
end
Expand Down

0 comments on commit 680ceb6

Please sign in to comment.