From 1bf72e485c3f2966ec3aad8e2307e5b0112398bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Knapik?= Date: Tue, 26 Apr 2016 10:20:42 +0200 Subject: [PATCH] Use rbhive fork 0.7.0 --- Gemfile | 2 ++ Gemfile.lock | 16 +++++++++++----- examples/spec/query_spec.rb | 9 +++++---- rspec-hive.gemspec | 2 +- spec/lib/rspec/hive/matchers_spec.rb | 6 +++--- 5 files changed, 22 insertions(+), 13 deletions(-) diff --git a/Gemfile b/Gemfile index fa75df1..7238a14 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,5 @@ source 'https://rubygems.org' gemspec + +gem 'rbhive', github: 'u2i/rbhive', tag: 'v0.7.0' diff --git a/Gemfile.lock b/Gemfile.lock index cdcdb7d..1382a1e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -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: @@ -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) @@ -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 @@ -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) diff --git a/examples/spec/query_spec.rb b/examples/spec/query_spec.rb index 18c692b..acb4a49 100644 --- a/examples/spec/query_spec.rb +++ b/examples/spec/query_spec.rb @@ -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) @@ -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) @@ -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 # diff --git a/rspec-hive.gemspec b/rspec-hive.gemspec index 4930b33..f119648 100644 --- a/rspec-hive.gemspec +++ b/rspec-hive.gemspec @@ -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' diff --git a/spec/lib/rspec/hive/matchers_spec.rb b/spec/lib/rspec/hive/matchers_spec.rb index 7d4ad21..1ab3176 100644 --- a/spec/lib/rspec/hive/matchers_spec.rb +++ b/spec/lib/rspec/hive/matchers_spec.rb @@ -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 } @@ -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