query_matchers 0.0.7 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 60172fb0c21e4e7a520e952a61cd5fd427307e75
4
- data.tar.gz: daa4269cd5b196c10df9e24985eef894e4cbb75b
3
+ metadata.gz: f78d721c38dc71a9253a97fcfa30a776b3b5b721
4
+ data.tar.gz: 92641ed402a948cea988adcc6bbdfe5a28c6ea13
5
5
  SHA512:
6
- metadata.gz: c56680c50df7e56ef723484877db38e97a8292db97f6830e59432648c1e46ae605a49214b17b03bc02fd96c48d752758b307fee7d6dac0658588de59264f1ea3
7
- data.tar.gz: 5e562e119472a89db8ae214b9d04eaaf5e3351dbbaf3c8ddbad1976db5b8c60ee00c7ba251a8d83871a9bd57081be6a30451b9f44ff9ad6d54d188a594127598
6
+ metadata.gz: 8225933bccc86b9dda7dd7d6ca23222b87be5867e9b683a7e9134992c19744d63155cbddb6128ae959684850a915bd701ca3a9b4b3115aa49d8353a15330cabf
7
+ data.tar.gz: 31c22139aaeaa65f0849652049548333980b638ee2c86a7b327ddc7e1201c838d43888b92808db8290f984634e38dad364e0c8fd8c0486768c4da4b07aea5d94
@@ -1,3 +1,3 @@
1
1
  module QueryMatchers
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
@@ -17,9 +17,9 @@ Gem::Specification.new do |spec|
17
17
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
18
  spec.require_paths = ["lib"]
19
19
 
20
- spec.add_runtime_dependency "activesupport", ["> 3.0", "< 5.1"]
20
+ spec.add_runtime_dependency "activesupport", ["> 3.0", "< 5.2"]
21
21
 
22
22
  spec.add_development_dependency "bundler", "~> 1.5"
23
23
  spec.add_development_dependency "rake"
24
- spec.add_development_dependency "rspec", "~> 2.14.0"
24
+ spec.add_development_dependency "rspec"
25
25
  end
@@ -8,44 +8,44 @@ describe QueryMatchers::QueryCounter do
8
8
  query = "SELECT * FROM somewhere"
9
9
  counter.execute!(sql_target(query))
10
10
 
11
- counter.queries.should == [query]
11
+ expect(counter.queries).to eq([query])
12
12
  end
13
13
 
14
14
  it "counts the number of queries performed in the target block" do
15
15
  target = proc { 3.times { perform_sql("INSERT INTO jokes") } }
16
16
  counter.execute!(target)
17
17
 
18
- counter.query_count.should == 3
18
+ expect(counter.query_count).to eq(3)
19
19
  end
20
20
 
21
21
  it "counts INSERT queries" do
22
22
  counter.execute!(sql_target("INSERT INTO jokes"))
23
23
 
24
- counter.query_count.should == 1
24
+ expect(counter.query_count).to eq(1)
25
25
  end
26
26
 
27
27
  it "counts UPDATE queries" do
28
28
  counter.execute!(sql_target("UPDATE mood SET laughing = 0"))
29
29
 
30
- counter.query_count.should == 1
30
+ expect(counter.query_count).to eq(1)
31
31
  end
32
32
 
33
33
  it "counts DELETE queries" do
34
34
  counter.execute!(sql_target("DELETE FROM goodwill"))
35
35
 
36
- counter.query_count.should == 1
36
+ expect(counter.query_count).to eq(1)
37
37
  end
38
38
 
39
39
  it "counts SELECT queries" do
40
40
  counter.execute!(sql_target("SELECT FROM inventory"))
41
41
 
42
- counter.query_count.should == 1
42
+ expect(counter.query_count).to eq(1)
43
43
  end
44
44
 
45
45
  it "doesn't count any other type of query" do
46
46
  counter.execute!(sql_target("BREAKDANCE"))
47
47
 
48
- counter.query_count.should == 0
48
+ expect(counter.query_count).to eq(0)
49
49
  end
50
50
 
51
51
  def sql_target(sql)
@@ -7,22 +7,22 @@ describe QueryMatchers::QueryExecutionMatcher do
7
7
 
8
8
  describe "#matches?" do
9
9
  before do
10
- counter.stub(:execute!)
10
+ allow(counter).to receive(:execute!)
11
11
  end
12
12
 
13
13
  it "executes the target" do
14
14
  matcher.matches?(:whatever)
15
- counter.should have_received(:execute!).with(:whatever)
15
+ expect(counter).to have_received(:execute!).with(:whatever)
16
16
  end
17
17
 
18
18
  it "returns true if the number of queries performed matched the expectation" do
19
- counter.stub(:query_count) { 4 }
20
- matcher.matches?(:whatever).should == true
19
+ allow(counter).to receive(:query_count) { 4 }
20
+ expect(matcher.matches?(:whatever)).to eq(true)
21
21
  end
22
22
 
23
23
  it "returns false if the number of queries performed doesn't match the expectation" do
24
- counter.stub(:query_count) { 3 }
25
- matcher.matches?(:whatever).should == false
24
+ allow(counter).to receive(:query_count) { 3 }
25
+ expect(matcher.matches?(:whatever)).to eq(false)
26
26
  end
27
27
  end
28
28
 
@@ -31,10 +31,10 @@ describe QueryMatchers::QueryExecutionMatcher do
31
31
  query1 = "SELECT FROM jokes WHERE puns > 3"
32
32
  query2 = "DELETE FROM jokes WHERE inappropriate = 1"
33
33
 
34
- counter.stub(:query_count) { 99 }
35
- counter.stub(:queries) { [query1, query2] }
34
+ allow(counter).to receive(:query_count) { 99 }
35
+ allow(counter).to receive(:queries) { [query1, query2] }
36
36
 
37
- matcher.failure_message.should == <<-MESSAGE.strip_heredoc.chomp
37
+ expect(matcher.failure_message).to eq <<-MESSAGE.strip_heredoc.chomp
38
38
  expected block to execute 4 SQL queries, but executed 99:
39
39
 
40
40
  - SELECT FROM jokes WHERE puns > 3
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: query_matchers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Schierbeck
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-01 00:00:00.000000000 Z
11
+ date: 2017-04-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '3.0'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '5.1'
22
+ version: '5.2'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: '3.0'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '5.1'
32
+ version: '5.2'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: bundler
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -62,16 +62,16 @@ dependencies:
62
62
  name: rspec
63
63
  requirement: !ruby/object:Gem::Requirement
64
64
  requirements:
65
- - - "~>"
65
+ - - ">="
66
66
  - !ruby/object:Gem::Version
67
- version: 2.14.0
67
+ version: '0'
68
68
  type: :development
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
- - - "~>"
72
+ - - ">="
73
73
  - !ruby/object:Gem::Version
74
- version: 2.14.0
74
+ version: '0'
75
75
  description:
76
76
  email:
77
77
  - dasch@zendesk.com
@@ -111,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
111
111
  version: '0'
112
112
  requirements: []
113
113
  rubyforge_project:
114
- rubygems_version: 2.6.6
114
+ rubygems_version: 2.6.11
115
115
  signing_key:
116
116
  specification_version: 4
117
117
  summary: Match the number of queries performed in any block of code