rspec-snapshot 0.1.0 → 0.1.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: 399a12bddd879883df59d2585f9b79f0af141f13
4
- data.tar.gz: 05f6017e55fa1cd0475e88c0c5c8c085a81ac9c2
3
+ metadata.gz: fb0c8d8ece5fdf281b87a40702c0c307fbc9acc4
4
+ data.tar.gz: 6a597e4338164f74256c34b1520535f9cd6dfa40
5
5
  SHA512:
6
- metadata.gz: a1e1bf2d3e3498d3edabc29e4327cd224086e6e0e4f5b990e33b5bd97e2ddb98b3b4d6360266e9cf46ef3352c2fb3b8faa42b21a9e57d3910354be1849453624
7
- data.tar.gz: e7c596351101233fe6faf2eaf2e567062b6abf256a2f1a935d626a1ea0376d920c27720a9b8dbb05660a7924b146b987b072240ac8138bc28fde355a3056e57b
6
+ metadata.gz: 8a26cc6d87062aa93ca016e4c292ba135efaa41f137a2454a34fc1973d900f9d45eea9eee8ce6299c1b42d94067e1db89e4c15348566d42d8cf4cc77fb6c81f2
7
+ data.tar.gz: 2f14f63bd2604709434ec5cdf86f3db655f10e82c0450fc05bf6ddff0335ad23abef8b40531b488a647a6a1d9fab60aec2f4319ca0cbfe8718c8e58ae1f54d27
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # RSpec::Snapshot
1
+ # RSpec::Snapshot [![Build Status](https://travis-ci.org/yesmeck/rspec-snapshot.svg?branch=master)](https://travis-ci.org/yesmeck/rspec-snapshot)
2
2
 
3
- Adding snapshot testing to RSpec, inspired by [jest](http://facebook.github.io/jest/blog/2016/07/27/jest-14.html).
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`, that means snapshots will be generate to
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 JSON API controller testing
33
+ ### Rails request testing
34
34
 
35
35
  ```ruby
36
- describe TeamsController do
37
- describe "GET index" do
38
- it "returns a list of team" do
39
- get :index
40
- expect(response.body).to match_snapshot('controllers/teams/index')
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('views/widgets/index')
59
+ expect(rendered).to match_snapshot("widgets/index")
59
60
  end
60
61
  end
61
62
  ```
@@ -1,4 +1,3 @@
1
- require "json"
2
1
  require "rspec/snapshot/matchers/match_snapshot"
3
2
 
4
3
  module RSpec
@@ -30,7 +30,7 @@ module RSpec
30
30
 
31
31
 
32
32
  def failure_message
33
- "\nexpected: #{@expect_snap}\n got: #{@actual_snap}\n"
33
+ "\nexpected: #{@expect}\n got: #{@actual}\n"
34
34
  end
35
35
 
36
36
  def snapshot_dir
@@ -1,5 +1,5 @@
1
1
  module RSpec
2
2
  module Snapshot
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
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.0
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: 2016-09-05 00:00:00.000000000 Z
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.4.8
123
+ rubygems_version: 2.6.8
124
124
  signing_key:
125
125
  specification_version: 4
126
126
  summary: RSpec Snapshot Matcher