rspice 0.8.3 → 0.8.4

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
  SHA256:
3
- metadata.gz: 59e6f4dcb34c1f0359965b25495c280d10f166bda4f3a073049113b9545d7e9c
4
- data.tar.gz: 2bc64a8a752a1356fc902a7790e287d275e5d6f07ae0a2b6723fc09c658c6160
3
+ metadata.gz: 6fa3fc0a06f54c841ff4749e205df15b8f63b837c63c6b89d962e8115b8186b1
4
+ data.tar.gz: 54fc61701af43f053585307ae0af8ccf6163ca8a0ae75383891a06117ad89038
5
5
  SHA512:
6
- metadata.gz: 4e9bff2d2a3be526acf4d48fe6cc23c2db32c73a4b731ba05b95417479f2667bbfa0240ce64d6f3302a4e26a16525a72edf8fa6af4c7f28df334e2184b6a511b
7
- data.tar.gz: c584edb15121fabd39d427b16cfc2f0f37aafccf2d464bd84b2c31dd2c6137672100663d714f44a849190d384d39c68338547fefba09bdc17878fcc2fd5222be
6
+ metadata.gz: 7959f0c8300a1a69749ba8622dcf8d50296acf5591b695c3f4caf2983c3ab672fcb6b4e76b0eb88d089abae2cf07d6a599fe0288d5b33ff47923da86a4324a7f
7
+ data.tar.gz: 6515c9d603be115e64c51bf65bd39f8819e253b46b9a97ddded0ad9c55ecf61a4e4e38dbdc73fee8914e2f5c2a442b8fc5265203406cb7f64973c36c26a02156
data/lib/rspice.rb CHANGED
@@ -3,6 +3,7 @@
3
3
  require "rspec"
4
4
  require "faker"
5
5
 
6
+ require "active_support/core_ext/array/wrap"
6
7
  require "active_support/core_ext/object/blank"
7
8
  require "active_support/core_ext/object/inclusion"
8
9
 
@@ -23,9 +23,9 @@ RSpec::Matchers.define :have_error_on_attribute do |attribute|
23
23
  match do |record|
24
24
  raise ArgumentError, "have_error_on_attribute matcher requires a detail_key" if @detail_key.blank?
25
25
 
26
- errors = (record.errors.details[attribute.to_sym] || []).pluck(:error)
26
+ @errors = (record.errors.details[attribute.to_sym] || []).pluck(:error).map(&:to_sym)
27
27
 
28
- expect(errors).to include(@detail_key)
28
+ expect(@errors).to include(@detail_key.to_sym)
29
29
  end
30
30
 
31
31
  chain :with_detail_key do |detail_key|
@@ -37,7 +37,7 @@ RSpec::Matchers.define :have_error_on_attribute do |attribute|
37
37
  end
38
38
 
39
39
  failure_message do |record|
40
- "expected #{record} to have error on attribute #{attribute} with detail key #{@detail_key.inspect}"
40
+ "expected #{record} to have error on attribute #{attribute} with detail key #{@detail_key.inspect}, got #{@errors}"
41
41
  end
42
42
 
43
43
  failure_message_when_negated do |record|
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Rspice
4
4
  # This constant is managed by spicerack
5
- VERSION = "0.8.3"
5
+ VERSION = "0.8.4"
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspice
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.3
4
+ version: 0.8.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Garside
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-13 00:00:00.000000000 Z
11
+ date: 2019-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec