rspec-memory 1.0.1 → 1.0.2
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 +4 -4
- data/.travis.yml +2 -0
- data/README.md +1 -1
- data/lib/rspec/memory/matchers/limit_allocations.rb +8 -2
- data/lib/rspec/memory/version.rb +1 -1
- data/rspec-memory.gemspec +1 -0
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f1d7b4e2fc50cd98f2e40bb5cb19f63c3972533912afa460d7391089f3241087
|
4
|
+
data.tar.gz: 2efe634f53910265f7f3ba43e76ec705455ef89e29a99d337e239de4231389bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 26198b9cce4b0cac807b26f5b23bd2f85b6cc85da77e6b5b7bd06028531c8d9f90fa1d6f429467b42761e603e8081b7928f7697c7f11c48d2f1d8efe34360945
|
7
|
+
data.tar.gz: 14bea85597166f34189f33450550d1ce3f2da0bb50d40efbc31c6c2afa1e6c53f4120eeb6e298add62e7e2543073aad40456a7c27a0c049dd0888cd5e8bfd538
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -28,7 +28,7 @@ require 'rspec/memory'
|
|
28
28
|
|
29
29
|
## Usage
|
30
30
|
|
31
|
-
Allocating large amounts of objects can lead to
|
31
|
+
Allocating large amounts of objects can lead to memory problems. `RSpec::Memory` adds a `limit_allocations` matcher, which tracks the number of allocations and memory size for each object type and allows you to specify expected limits.
|
32
32
|
|
33
33
|
```ruby
|
34
34
|
RSpec.describe "memory allocations" do
|
@@ -105,8 +105,14 @@ module RSpec
|
|
105
105
|
end
|
106
106
|
end
|
107
107
|
|
108
|
-
|
109
|
-
|
108
|
+
if respond_to?(:ruby2_keywords, true)
|
109
|
+
def limit_allocations(count: nil, size: nil, **allocations)
|
110
|
+
LimitAllocations.new(allocations, count: count, size: size)
|
111
|
+
end
|
112
|
+
else
|
113
|
+
def limit_allocations(*arguments)
|
114
|
+
LimitAllocations.new(*arguments)
|
115
|
+
end
|
110
116
|
end
|
111
117
|
end
|
112
118
|
end
|
data/lib/rspec/memory/version.rb
CHANGED
data/rspec-memory.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-memory
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-03-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -86,7 +86,8 @@ files:
|
|
86
86
|
- lib/rspec/memory/version.rb
|
87
87
|
- rspec-memory.gemspec
|
88
88
|
homepage: https://github.com/socketry/rspec-memory
|
89
|
-
licenses:
|
89
|
+
licenses:
|
90
|
+
- MIT
|
90
91
|
metadata: {}
|
91
92
|
post_install_message:
|
92
93
|
rdoc_options: []
|
@@ -103,7 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
103
104
|
- !ruby/object:Gem::Version
|
104
105
|
version: '0'
|
105
106
|
requirements: []
|
106
|
-
rubygems_version: 3.
|
107
|
+
rubygems_version: 3.1.2
|
107
108
|
signing_key:
|
108
109
|
specification_version: 4
|
109
110
|
summary: RSpec helpers for checking memory allocations.
|