rspec-snapshot 0.1.0 → 0.1.1
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/README.md +12 -11
- data/lib/rspec/snapshot/matchers.rb +0 -1
- data/lib/rspec/snapshot/matchers/match_snapshot.rb +1 -1
- data/lib/rspec/snapshot/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb0c8d8ece5fdf281b87a40702c0c307fbc9acc4
|
4
|
+
data.tar.gz: 6a597e4338164f74256c34b1520535f9cd6dfa40
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a26cc6d87062aa93ca016e4c292ba135efaa41f137a2454a34fc1973d900f9d45eea9eee8ce6299c1b42d94067e1db89e4c15348566d42d8cf4cc77fb6c81f2
|
7
|
+
data.tar.gz: 2f14f63bd2604709434ec5cdf86f3db655f10e82c0450fc05bf6ddff0335ad23abef8b40531b488a647a6a1d9fab60aec2f4319ca0cbfe8718c8e58ae1f54d27
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
# RSpec::Snapshot
|
1
|
+
# RSpec::Snapshot [](https://travis-ci.org/yesmeck/rspec-snapshot)
|
2
2
|
|
3
|
-
Adding snapshot testing to RSpec, inspired by [
|
3
|
+
Adding snapshot testing to RSpec, inspired by [Jest](http://facebook.github.io/jest/blog/2016/07/27/jest-14.html).
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -24,20 +24,21 @@ Or install it yourself as:
|
|
24
24
|
|
25
25
|
```ruby
|
26
26
|
RSpec.configure do |config|
|
27
|
-
# The default setting is `:relative`,
|
27
|
+
# The default setting is `:relative`, which means snapshots will be generate to
|
28
28
|
# the relative path of the spec file.
|
29
29
|
config.snapshot_dir = "spec/fixtures/snapshots"
|
30
30
|
end
|
31
31
|
```
|
32
32
|
|
33
|
-
### Rails
|
33
|
+
### Rails request testing
|
34
34
|
|
35
35
|
```ruby
|
36
|
-
describe
|
37
|
-
describe "GET
|
38
|
-
it "returns a list of
|
39
|
-
get
|
40
|
-
|
36
|
+
RSpec.describe "Posts", type: :request do
|
37
|
+
describe "GET /posts" do
|
38
|
+
it "returns a list of post" do
|
39
|
+
get posts_path
|
40
|
+
|
41
|
+
expect(response.body).to match_snapshot("get_posts")
|
41
42
|
end
|
42
43
|
end
|
43
44
|
end
|
@@ -46,7 +47,7 @@ end
|
|
46
47
|
### Rails view testing
|
47
48
|
|
48
49
|
```ruby
|
49
|
-
describe "widgets/index" do
|
50
|
+
RSpec.describe "widgets/index", type: :view do
|
50
51
|
it "displays all the widgets" do
|
51
52
|
assign(:widgets, [
|
52
53
|
Widget.create!(:name => "slicer"),
|
@@ -55,7 +56,7 @@ describe "widgets/index" do
|
|
55
56
|
|
56
57
|
render
|
57
58
|
|
58
|
-
expect(rendered).to match_snapshot(
|
59
|
+
expect(rendered).to match_snapshot("widgets/index")
|
59
60
|
end
|
60
61
|
end
|
61
62
|
```
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-snapshot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wei Zhu
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -120,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
120
120
|
version: '0'
|
121
121
|
requirements: []
|
122
122
|
rubyforge_project:
|
123
|
-
rubygems_version: 2.
|
123
|
+
rubygems_version: 2.6.8
|
124
124
|
signing_key:
|
125
125
|
specification_version: 4
|
126
126
|
summary: RSpec Snapshot Matcher
|