db-query-matchers 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c7c9f607891bbb0b674c410baae4a3fe9456e83c
4
- data.tar.gz: 8d6f264f879659422b69ac07c3b4b0441952d7a6
3
+ metadata.gz: e6a8e87485793abed45478133129719d1794c074
4
+ data.tar.gz: 13c4807b0e84756527044f649a379107db93d0ad
5
5
  SHA512:
6
- metadata.gz: 23b5db77346a98ecd7c9ab0db61bd3cec815f42532e819a3310847c8241211c6dbc9b0aae21acf7e803d8243c195bcb15c49dd666bf377db96561ef657bb92b5
7
- data.tar.gz: 12217e1be76989c510ce4b46665b6ff8e0b7ffb6caa334b441eda7c23de0aced5cae097aaaf3a4e88fe86733692a3e13792ff678abfbd915d070fbc4d7eb81bb
6
+ metadata.gz: b9ef241b736e78ebf2d0f1df05448d42418caa5392551830ad6fdfb408dde6108b5bed57b1fb3276031448d91144f06725094e47104107009ffc15b8dc3d2787
7
+ data.tar.gz: f23c877e9cf641e7915c281ec70cde40df1647e30d81b58154637cd57fefea8cdb5a1eb0ee3e1f69507058be62b56516d97d1774e4aee55983efeb9d9523372c
@@ -47,6 +47,15 @@ RSpec::Matchers.define :make_database_queries do |options = {}|
47
47
  if options[:manipulative]
48
48
  counter_options[:matches] = [/^\ *(INSERT|UPDATE|DELETE\ FROM)/]
49
49
  end
50
+ if options[:matching]
51
+ counter_options[:matches] ||= []
52
+ case options[:matching]
53
+ when Regexp
54
+ counter_options[:matches] << options[:matching]
55
+ when String
56
+ counter_options[:matches] << Regexp.new(Regexp.escape(options[:matching]))
57
+ end
58
+ end
50
59
  @counter = DBQueryMatchers::QueryCounter.new(counter_options)
51
60
  ActiveSupport::Notifications.subscribed(@counter.to_proc,
52
61
  'sql.active_record',
@@ -1,4 +1,4 @@
1
1
  # Defines the gem version.
2
2
  module DBQueryMatchers
3
- VERSION = '0.3.0'
3
+ VERSION = '0.3.1'
4
4
  end
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: db-query-matchers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
- - Causes Engineering
7
+ - Brigade Engineering
8
8
  - Henric Trotzig
9
9
  - Joe Lencioni
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-01-22 00:00:00.000000000 Z
13
+ date: 2015-05-24 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rspec
@@ -70,9 +70,9 @@ dependencies:
70
70
  version: '0'
71
71
  description:
72
72
  email:
73
- - eng@causes.com
74
- - henric.trotzig@causes.com
75
- - joe.lencioni@causes.com
73
+ - eng@brigade.com
74
+ - henric.trotzig@brigade.com
75
+ - joe.lencioni@brigade.com
76
76
  executables: []
77
77
  extensions: []
78
78
  extra_rdoc_files: []
@@ -83,7 +83,7 @@ files:
83
83
  - lib/db_query_matchers/make_database_queries.rb
84
84
  - lib/db_query_matchers/query_counter.rb
85
85
  - lib/db_query_matchers/version.rb
86
- homepage: https://github.com/causes/db-query-matchers
86
+ homepage: https://github.com/brigade/db-query-matchers
87
87
  licenses:
88
88
  - MIT
89
89
  metadata: {}
@@ -103,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
103
  version: '0'
104
104
  requirements: []
105
105
  rubyforge_project:
106
- rubygems_version: 2.2.2
106
+ rubygems_version: 2.4.5
107
107
  signing_key:
108
108
  specification_version: 4
109
109
  summary: RSpec matchers for database queries