rspec-activerecord-formatter 1.2.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/rspec/activerecord/helpers/collector.rb +10 -0
- data/rspec-activerecord-formatter.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: '08dd87f7aa390ba4918b877798c35de853c02243'
|
4
|
+
data.tar.gz: f4e7986bc385496bdc26213995fb109765be26fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 740c19e2671ea78b0460fd83a3f1c08ef4c40fa120bf495fff54bd7970a5bca3c9144e128542b54e6c1606dbbc8ac52b153d6d00b37618a479d0881e8acd1264
|
7
|
+
data.tar.gz: b2e55d67fc0b296e847f75c20ec6a6352f871322ccb0403c9f56ccbd0a2b4ad23db44b99f7c87f6b041b03c4e9a7caf19165d9ac8742bd911292d91719247c82
|
@@ -69,6 +69,16 @@ module ActiveRecordFormatterHelpers
|
|
69
69
|
def inc_query_name(data)
|
70
70
|
name = data[:name] || "Unnamed"
|
71
71
|
|
72
|
+
# In older versions of Rails, insert statements are just counted as SQL
|
73
|
+
# queries, which means that all the queries are just bunchedup at the top.
|
74
|
+
# Makes this data pretty useless. So anyway, try to suss out a name for
|
75
|
+
# at least those insertions (which are much more frequent than, say,
|
76
|
+
# updates in a test suite anyway).
|
77
|
+
if data[:name] == "SQL" && query_is_an_insert?(data[:sql])
|
78
|
+
table = data[:sql].scan(/INSERT INTO "(\w+)"/).first.first
|
79
|
+
name = "#{table} Create"
|
80
|
+
end
|
81
|
+
|
72
82
|
query_names[name] += 1
|
73
83
|
end
|
74
84
|
|
@@ -6,7 +6,7 @@ $LOAD_PATH << lib_dir unless $LOAD_PATH.include?(lib_dir)
|
|
6
6
|
Gem::Specification.new do |gem|
|
7
7
|
|
8
8
|
gem.name = "rspec-activerecord-formatter"
|
9
|
-
gem.version = "1.
|
9
|
+
gem.version = "1.3.0"
|
10
10
|
|
11
11
|
gem.summary = "Adds object creations and queries to Rspec output."
|
12
12
|
gem.description = "Creates a new formatter for ActiveRecord that can help you diagnose performance issues in RSpec"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-activerecord-formatter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joseph Mastey
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-07-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -98,7 +98,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
98
98
|
version: '0'
|
99
99
|
requirements: []
|
100
100
|
rubyforge_project:
|
101
|
-
rubygems_version: 2.
|
101
|
+
rubygems_version: 2.6.13
|
102
102
|
signing_key:
|
103
103
|
specification_version: 4
|
104
104
|
summary: Adds object creations and queries to Rspec output.
|