decorator_dryer 0.1.2 → 0.1.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: acaab9b600b806da72034503fd1248a8fd1a04cd9ce40da3b7a2ace4ae152f9c
4
- data.tar.gz: b27d7230005a389d8d386032d9b754bc587f9544194254c917d47c00a3a93197
3
+ metadata.gz: b2b5ffec7f0a9d0ed8372f6a8ab3433a2daab3ea6fc1068ad79b1ba36061e990
4
+ data.tar.gz: 2cebca175fc5e36be748707c2bae014d20678df21d1d6add37762e58acfef3f8
5
5
  SHA512:
6
- metadata.gz: f53634e3a21b84ddd288c19ccb4042654793372619c16bfdd984c1a8cc824430baf185950bd606a4ecf90de73b5ad1f22484efaae530b0f1a1890d1883aa851c
7
- data.tar.gz: 30d393ba4083a7bbd7b748752bad269db75c1e51dbe34272a676c1a7e78851e47ff10c352e56f530559a56b26d3d2823e5a51d3ff65198ad9a83255a5c363089
6
+ metadata.gz: 769b19aedb2d3d7b617bbbd7b1bd473c5b371a8fb0afb520134c20b5af9b926d1130441e008697e4072ad5fb535bfca2392503215959c2ac194792f02f896c96
7
+ data.tar.gz: fc53714bc8a1c60a28adc349e5f2afe6d9989aeb9750b29271cb8da83980e3fb91e18c7741557f7ab4da5699fdeaff47380c22a93e19255061a72d42f4ccb4a3
@@ -8,7 +8,7 @@ module DecoratorDryer
8
8
  #
9
9
  # @example
10
10
  # expect(user).to format_field_to_name(:role)
11
- RSpec::Matchers.define :format_field_to_name do |field|
11
+ ::RSpec::Matchers.define :format_field_to_name do |field|
12
12
  match do |subject|
13
13
  subject.decorate.send("#{field}_name") == subject.send(field).try(:name)
14
14
  end
@@ -24,7 +24,7 @@ module DecoratorDryer
24
24
  #
25
25
  # @example
26
26
  # expect(post).to format_field_to_datetime(:published_at)
27
- RSpec::Matchers.define :format_field_to_datetime do |field|
27
+ ::RSpec::Matchers.define :format_field_to_datetime do |field|
28
28
  match do |subject|
29
29
  subject.decorate.send(field) == subject.send(field).try(:strftime, '%Y-%m-%d %H:%M')
30
30
  end
@@ -40,7 +40,7 @@ module DecoratorDryer
40
40
  #
41
41
  # @example
42
42
  # expect(event).to format_field_to_date(:start_date)
43
- RSpec::Matchers.define :format_field_to_date do |field|
43
+ ::RSpec::Matchers.define :format_field_to_date do |field|
44
44
  match do |subject|
45
45
  subject.decorate.send(field) == subject.send(field).try(:strftime, '%Y-%m-%d')
46
46
  end
@@ -56,7 +56,7 @@ module DecoratorDryer
56
56
  #
57
57
  # @example
58
58
  # expect(schedule).to format_field_to_time(:start_time)
59
- RSpec::Matchers.define :format_field_to_time do |field|
59
+ ::RSpec::Matchers.define :format_field_to_time do |field|
60
60
  match do |subject|
61
61
  subject.decorate.send(field) == subject.send(field).try(:strftime, '%H:%M')
62
62
  end
@@ -72,7 +72,7 @@ module DecoratorDryer
72
72
  #
73
73
  # @example
74
74
  # expect(product).to format_field_to_precision_number(:price, 2)
75
- RSpec::Matchers.define :format_field_to_precision_number do |field, precision|
75
+ ::RSpec::Matchers.define :format_field_to_precision_number do |field, precision|
76
76
  match do |subject|
77
77
  subject.decorate.send(field) == number_with_precision(subject.send(field), precision: precision)
78
78
  end
@@ -88,7 +88,7 @@ module DecoratorDryer
88
88
  #
89
89
  # @example
90
90
  # expect(order).to delegate_field(:email, :customer)
91
- RSpec::Matchers.define :delegate_field do |field, association|
91
+ ::RSpec::Matchers.define :delegate_field do |field, association|
92
92
  match do |subject|
93
93
  subject.decorate.send(field) == subject.send(association).decorate.send(field)
94
94
  end
@@ -105,7 +105,7 @@ module DecoratorDryer
105
105
  #
106
106
  # @example
107
107
  # expect(order).to delegate_field_with_prefix(:email, :customer)
108
- RSpec::Matchers.define :delegate_field_with_prefix do |field, association|
108
+ ::RSpec::Matchers.define :delegate_field_with_prefix do |field, association|
109
109
  match do |subject|
110
110
  subject.decorate.send("#{association}_#{field}") ==
111
111
  subject.send(association).decorate.send(field)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DecoratorDryer
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.3"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decorator_dryer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Harbison