approvals 0.0.20 → 0.0.21

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: 23b24cfaf9706d8ead8d9c1a436025d983ac8c7b
4
- data.tar.gz: b5ee817b9554e90d064ebc0572f3f8786fbb429a
3
+ metadata.gz: 83fdc1b67aa0b4262df63630332d038a42c04de8
4
+ data.tar.gz: ade116ca8534915b28e6d052a3f8d215c915cdb3
5
5
  SHA512:
6
- metadata.gz: 1d64e7023845cfa1b25365bf09682849e0d1b9912b44c621994badab49ed46be3deda93db41468a28e7eb88e95fa5fa7d02d197647b1a33a7aa52b96fda725c6
7
- data.tar.gz: c4f5a05a1cb1e317c69aae65f931a3521f1cfda9cfca0faf455052a1904a53c6c961fb6898dbca5908649c0defd7db5eb75708eadac11322e605bc5e98f76fd0
6
+ metadata.gz: c76a9cf43067226a8a74178c4b5b762d9c6132ac781b4680324023e9a35c39c2383c6fc7a8b9341fd144704b718ef1282c00ff2addf673699a3f1d31d299a5d9
7
+ data.tar.gz: 23b5b8ce78c15b97a4665eb6daaaca00eccba0ae5e9841743d5bf9483ce5bad5d017e8e76a95bf376414929a4dad60832990fe22baa6975c171df5d065ba718a
@@ -2,6 +2,7 @@
2
2
 
3
3
  ### Next Release
4
4
 
5
+ * [#64](https://github.com/kytrinyx/approvals/pull/64) Silence deprecation warnings - [@tmock12](https://github.com/tmock12)
5
6
  * Your contribution here
6
7
 
7
8
  ### v0.0.20 (2015-04-21)
data/README.md CHANGED
@@ -165,7 +165,7 @@ verify :format => :json do
165
165
  end
166
166
  ```
167
167
 
168
- ### Exclude dynamicly changed values from json
168
+ ### Exclude dynamically changed values from json
169
169
 
170
170
  ```ruby
171
171
  Approvals.configure do |c|
@@ -1,4 +1,4 @@
1
- require 'erb' # It is referenced on line 56
1
+ require 'erb' # It is referenced on line 69
2
2
  module Approvals
3
3
  class Approval
4
4
  class << self
@@ -35,7 +35,7 @@ module Approvals
35
35
  end
36
36
 
37
37
  def verify
38
- unless File.exists?(namer.output_dir)
38
+ unless File.exist?(namer.output_dir)
39
39
  FileUtils.mkdir_p(namer.output_dir)
40
40
  end
41
41
 
@@ -57,11 +57,11 @@ module Approvals
57
57
  end
58
58
 
59
59
  def approved?
60
- File.exists? approved_path
60
+ File.exist? approved_path
61
61
  end
62
62
 
63
63
  BINARY_FORMATS = [:binary]
64
-
64
+
65
65
  def received_matches?
66
66
  if BINARY_FORMATS.include?(@format) # Read without ERB
67
67
  IO.read(received_path).chomp == IO.read(approved_path).chomp
@@ -4,7 +4,7 @@ module Approvals
4
4
  class << self
5
5
 
6
6
  def reset
7
- File.truncate(path, 0) if File.exists?(path)
7
+ File.truncate(path, 0) if File.exist?(path)
8
8
  end
9
9
 
10
10
  def append(text)
@@ -20,7 +20,7 @@ module Approvals
20
20
  when Array
21
21
  value.map { |item| censored(item) }
22
22
  when Hash
23
- Hash[value.map { |key, value| [key, censored(value, key)] }]
23
+ Hash[value.map { |inner_key, inner_value| [inner_key, censored(inner_value, inner_key)] }]
24
24
  else
25
25
  if value.nil?
26
26
  nil
@@ -1,17 +1,13 @@
1
1
  module Approvals
2
2
  module Namers
3
3
  class DirectoryNamer < RSpecNamer
4
+ private
4
5
 
5
- def initialize(example)
6
- @name = directorize example
6
+ def name_for_example(example)
7
+ directorize example
7
8
  end
8
9
 
9
- private
10
-
11
10
  def directorize(example)
12
- parts = [ ]
13
- metadata = example.metadata
14
-
15
11
  approvals_path = lambda do |metadata|
16
12
  description = normalize metadata[:description]
17
13
  example_group = if metadata.key?(:example_group)
@@ -1,10 +1,15 @@
1
1
  module Approvals
2
2
  module Namers
3
3
  class RSpecNamer
4
-
5
4
  attr_reader :name
5
+
6
6
  def initialize(example)
7
- @name = normalize example.full_description
7
+ @name = name_for_example(example)
8
+ @output_dir = nil
9
+ end
10
+
11
+ def name_for_example(example)
12
+ normalize example.full_description
8
13
  end
9
14
 
10
15
  def normalize(string)
@@ -15,7 +20,7 @@ module Approvals
15
20
  unless @output_dir
16
21
  begin
17
22
  @output_dir = ::RSpec.configuration.approvals_path
18
- rescue NoMethodError => e
23
+ rescue NoMethodError
19
24
  end
20
25
  @output_dir ||= 'spec/fixtures/approvals/'
21
26
  end
@@ -1,3 +1,3 @@
1
1
  module Approvals
2
- VERSION = '0.0.20'
2
+ VERSION = '0.0.21'
3
3
  end
@@ -6,19 +6,13 @@ module Approvals
6
6
  end
7
7
 
8
8
  def initialize(opts = {})
9
- self.autoregister = opts[:autoregister] || true
10
- self.detect = opts[:detect]
11
- self.extension = opts[:extension] || ''
12
- self.write = opts[:write] || EXCEPTION_WRITER
9
+ @autoregister = opts[:autoregister] || true
10
+ @detect = opts[:detect]
11
+ @extension = opts[:extension] || ''
12
+ @write = opts[:write] || EXCEPTION_WRITER
13
13
  self.format = opts[:format] || :binary
14
14
  end
15
15
 
16
- attr_accessor :autoregister
17
- attr_accessor :extension
18
- attr_accessor :write
19
- attr_accessor :detect
20
-
21
-
22
16
  attr_reader :format
23
17
 
24
18
  def format=(sym)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: approvals
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.20
4
+ version: 0.0.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Katrina Owen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-21 00:00:00.000000000 Z
11
+ date: 2015-10-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec