rspec-page-regression 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/lib/rspec/page-regression/file_paths.rb +4 -2
- data/lib/rspec/page-regression/version.rb +1 -1
- data/spec/match_expectation_spec.rb +9 -0
- data/spec/support/helpers.rb +5 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1847e77587cf7d17aa62ef348dcf6d727a0f7d69
|
4
|
+
data.tar.gz: 8e6d648fa23c69519fee4b9da629076161e491f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd8f790e145225044a389b346f9dcf474397ee7d3d0b2293ec50aedc4c6ec798d15ceafb5c0dc6af0100956ed705edad3a7e77eaa52fe192f788a6903088efd5
|
7
|
+
data.tar.gz: ef4d7943130cd145f991fc5d8f9a77d648955c1d323365304682d95f9b2fc6be38f453fd09cb96da1175c55791778f75f77e6a2f6c589f19e03b0ab57fedc86d
|
data/README.md
CHANGED
@@ -168,6 +168,8 @@ Don't forget to include specs (`rake spec`) to verify your functionality. Code
|
|
168
168
|
|
169
169
|
Release Notes:
|
170
170
|
|
171
|
+
* 0.4.1 - Bug fix: wasn't including example name in file path. Thanks to [@kurtisnelson](https://github.com/kurtisnelson)
|
172
|
+
|
171
173
|
* 0.4.0 - Add difference threshold. Thanks to [@abersager](https://github.com/abersager)
|
172
174
|
|
173
175
|
* 0.3.0 - Compatibility with rspec 3.0
|
@@ -10,9 +10,11 @@ module RSpec::PageRegression
|
|
10
10
|
expected_path = Pathname.new(expected_path) if expected_path
|
11
11
|
|
12
12
|
descriptions = description_ancestry(example.metadata[:example_group])
|
13
|
-
descriptions.
|
13
|
+
descriptions.push example.description unless example.description.parameterize('_') =~ %r{
|
14
14
|
^
|
15
|
-
(then_+)?
|
15
|
+
(then_+)?
|
16
|
+
( (expect_+) (page_+) (to_+) (not_+)? | (page_+) (should_+)? )
|
17
|
+
match_expectation
|
16
18
|
(_#{Regexp.escape(expected_path.to_s)})?
|
17
19
|
$
|
18
20
|
}xi
|
@@ -13,6 +13,15 @@ describe "match_expectation" do
|
|
13
13
|
@match_argument = nil
|
14
14
|
}
|
15
15
|
|
16
|
+
context "helpers" do
|
17
|
+
it "use proper paths" do
|
18
|
+
expect(expected_path).to eq Pathname.new("spec/expectation/match_expectation/helpers/use_proper_paths/expected.png")
|
19
|
+
expect(test_path).to eq Pathname.new("tmp/spec/expectation/match_expectation/helpers/use_proper_paths/test.png")
|
20
|
+
expect(difference_path).to eq Pathname.new("tmp/spec/expectation/match_expectation/helpers/use_proper_paths/difference.png")
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
|
16
25
|
context "using expect().to" do
|
17
26
|
|
18
27
|
When {
|
data/spec/support/helpers.rb
CHANGED
@@ -13,7 +13,11 @@ module Helpers
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def getpath(root, base)
|
16
|
-
(root + "expectation" +
|
16
|
+
(root + "expectation" + example_path(RSpec.current_example) + "#{base}.png").relative_path_from Pathname.getwd
|
17
|
+
end
|
18
|
+
|
19
|
+
def example_path(example)
|
20
|
+
group_path(example.metadata[:example_group]) + example.description.parameterize("_")
|
17
21
|
end
|
18
22
|
|
19
23
|
def group_path(metadata)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-page-regression
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ronen barzel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-09-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|