friendly-attributes 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,6 +1,10 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ ### 0.3.2
5
+
6
+ * (ihoka) Added description to spec matcher.
7
+
4
8
  ### 0.3.1
5
9
 
6
10
  * (ihoka) added spec matchers
@@ -9,11 +9,10 @@ module FriendlyAttributes
9
9
  end
10
10
 
11
11
  def matches?(actual)
12
- @actual = actual
13
- actual = Class === actual ? actual : actual.class
12
+ @actual = Class === actual ? actual : actual.class
14
13
 
15
- result = actual.ancestors.include?(FriendlyAttributes) && @attributes.all? { |attr|
16
- actual.friendly_model.attributes.include?(attr) && actual.friendly_model.attributes[attr].type == @type
14
+ result = @actual.ancestors.include?(FriendlyAttributes) && @attributes.all? { |attr|
15
+ @actual.friendly_model.attributes.include?(attr) && @actual.friendly_model.attributes[attr].type == @type
17
16
  }
18
17
  end
19
18
 
@@ -24,6 +23,10 @@ module FriendlyAttributes
24
23
  def negative_failure_message
25
24
  "expected #{@actual.inspect} not to have friendly attributes #{@attributes.inspect}"
26
25
  end
26
+
27
+ def description
28
+ "have [#{@actual}] friendly_attributes of type #{@type} => #{@attributes.inspect}"
29
+ end
27
30
  end
28
31
 
29
32
  def have_friendly_attributes(*args)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: friendly-attributes
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 1
10
- version: 0.3.1
9
+ - 2
10
+ version: 0.3.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Istvan Hoka