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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 16be31d2cd913d4f1c0e4d8e8cfe17236478aafe
4
- data.tar.gz: 3cfc21083eb4dc17b28f4ba4496d9d437eb76401
3
+ metadata.gz: 1847e77587cf7d17aa62ef348dcf6d727a0f7d69
4
+ data.tar.gz: 8e6d648fa23c69519fee4b9da629076161e491f9
5
5
  SHA512:
6
- metadata.gz: bbe34659c64d36c19ae203ea9ce0bbea48505009ec7cc9b984c45412a9e17e2602954eac59892b67e7582960a638e490b619217cf8985f275a865f46949eec75
7
- data.tar.gz: 9a271da665070a549833b805294f5ddf8d6a8495d3c986debdd72d2d045f99a133bee974a00e3885ee9466ef63e1a705badde5e86ceb2ab9bd0769dcffac4576
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.pop if descriptions.last =~ %r{
13
+ descriptions.push example.description unless example.description.parameterize('_') =~ %r{
14
14
  ^
15
- (then_+)? (page_+)? (should_+)? match_expectation
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
@@ -1,5 +1,5 @@
1
1
  module RSpec
2
2
  module PageRegression
3
- VERSION = "0.4.0"
3
+ VERSION = "0.4.1"
4
4
  end
5
5
  end
@@ -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 {
@@ -13,7 +13,11 @@ module Helpers
13
13
  end
14
14
 
15
15
  def getpath(root, base)
16
- (root + "expectation" + group_path(RSpec.current_example.metadata[:example_group]) + "#{base}.png").relative_path_from Pathname.getwd
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.0
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-07-22 00:00:00.000000000 Z
11
+ date: 2015-09-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport