assertion 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/CHANGELOG.md +13 -0
- data/README.md +42 -8
- data/Rakefile +1 -1
- data/lib/assertion/base.rb +3 -1
- data/lib/assertion/dsl/attribute.rb +16 -3
- data/lib/assertion/dsl/attributes.rb +2 -2
- data/lib/assertion/dsl/inversion.rb +1 -0
- data/lib/assertion/guard.rb +6 -0
- data/lib/assertion/rspec.rb +24 -24
- data/lib/assertion/state.rb +1 -2
- data/lib/assertion/translator.rb +2 -18
- data/lib/assertion/version.rb +1 -1
- data/spec/integration/assertion_spec.rb +26 -4
- data/spec/unit/assertion/base_spec.rb +15 -2
- data/spec/unit/assertion/dsl/inversion_spec.rb +12 -1
- data/spec/unit/assertion/translator_spec.rb +2 -11
- metadata +21 -21
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
NzUwZjQ2NDA5MzM5NDU5MmJiMWU3NGQ3ZThlM2Q3MjM2MDM2OTM5MQ==
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 65ecfa1663da2ccf5c270513980850376ab8b4f4
|
4
|
+
data.tar.gz: f30f44133b412b3d8162f335c3662ff1abab40a5
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
ZjE5OWUyODAzMDFmMDYxOTcwMDc1M2MxZjMwOThiODhjYjI0ZDBiZmQ4ODcy
|
11
|
-
MjdkNmFkMmQxMDhiMjJjOTUyMmM0MTQ1ZTdkODg2ODFhZmE3ZGM=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
ZDkyMjZkNDk3NzhhYjExYTBmNzlkY2U1YjkxMzg1ZTQwYjMwMTRjMzZkN2Rj
|
14
|
-
MDBlMTFjMzBjNGU5MmY3ZTI4OWMwOGQ1MTE1ZDM1MzY0MTg5ZDdjMzNmMjAx
|
15
|
-
NjM3YWRhNGVmYjE2NzZhNmRlMzFlZTU2YTQ1YzE5NzFiYmEwNmM=
|
6
|
+
metadata.gz: 561a3f4d22029666cfe4bec2d720792a562c4ca11f7de8ec088dc54eba998c243fea503d6a5ef98aa0272e34c6e376a7b9e7a994a1dbb4ee2444f45788f6e28a
|
7
|
+
data.tar.gz: 3e46a54c25ebc71033efad3fdf676436cd8f64534206a2e4bbb849ca8c47e5ef465ee7dd6c60add7052d4c806d80766f17570d6260dc4bc7738de33268c1edcd
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,16 @@
|
|
1
|
+
## v0.2.4 2015-07-31
|
2
|
+
|
3
|
+
### Added
|
4
|
+
|
5
|
+
* Support for inline messages definition via `#falsey` and `#truthy` methods (nepalez)
|
6
|
+
* Alias method `!` for assertion `not` inverter (nepalez)
|
7
|
+
|
8
|
+
### Internal
|
9
|
+
|
10
|
+
* Moved names `:falsey` and `:truthy` from `Translator` to `Base` (nepalez)
|
11
|
+
|
12
|
+
[Compare v0.2.3...v0.2.4](https://github.com/nepalez/assertion/compare/v0.2.3...v0.2.4)
|
13
|
+
|
1
14
|
## v0.2.3 2015-07-12
|
2
15
|
|
3
16
|
The version is bumped to fix bugs that proved to be hidden because of bugs in hexx-rspec and hexx-suit gems.
|
data/README.md
CHANGED
@@ -17,16 +17,16 @@ Assertion
|
|
17
17
|
|
18
18
|
Standalone PORO assertions and validations.
|
19
19
|
|
20
|
-
Synopsis
|
21
|
-
--------
|
22
|
-
|
23
20
|
The primary goal of the gem is to make standalone assertions about objects and validate them.
|
24
21
|
|
25
22
|
No monkey patching, no dependency from ActiveSupport, no mutable instances of any class.
|
26
23
|
|
27
24
|
[About](https://github.com/mbj/mutant/issues/356) 100% [mutant]-covered.
|
28
25
|
|
29
|
-
|
26
|
+
Synopsis
|
27
|
+
--------
|
28
|
+
|
29
|
+
### Make an Assertion
|
30
30
|
|
31
31
|
Define an assertion by inheriting it from the `Assertion::Base` class with attributes to which it should be applied.
|
32
32
|
Then implement the method `check` to describe if the assertion is truthy or falsey.
|
@@ -43,7 +43,7 @@ class IsAdult < Assertion::Base
|
|
43
43
|
end
|
44
44
|
```
|
45
45
|
|
46
|
-
or with more
|
46
|
+
or with more expressive builder:
|
47
47
|
|
48
48
|
```ruby
|
49
49
|
IsAdult = Assertion.about :age, :name do
|
@@ -51,6 +51,8 @@ IsAdult = Assertion.about :age, :name do
|
|
51
51
|
end
|
52
52
|
```
|
53
53
|
|
54
|
+
### Add Messages
|
55
|
+
|
54
56
|
Define translations to describe both the *truthy* and *falsey* states of the assertion.
|
55
57
|
|
56
58
|
All the attributes are available in translations (that's why we declared the `name` as an attribute):
|
@@ -65,6 +67,28 @@ en:
|
|
65
67
|
falsey: "%{name} is a child yet (age %{age})"
|
66
68
|
```
|
67
69
|
|
70
|
+
If you don't need to translate messages, define them for `truthy` and `falsey` states as methods:
|
71
|
+
|
72
|
+
```ruby
|
73
|
+
class IsAdult < Assertion::Base
|
74
|
+
attribute :age, :name
|
75
|
+
|
76
|
+
def check
|
77
|
+
age.to_i >= 18
|
78
|
+
end
|
79
|
+
|
80
|
+
def truthy
|
81
|
+
"#{name} is already an adult (age #{age})"
|
82
|
+
end
|
83
|
+
|
84
|
+
def falsey
|
85
|
+
"#{name} is a child yet (age #{age})"
|
86
|
+
end
|
87
|
+
end
|
88
|
+
```
|
89
|
+
|
90
|
+
### Check a State
|
91
|
+
|
68
92
|
Check a state of an assertion for some argument(s), using class method `[]`:
|
69
93
|
|
70
94
|
```ruby
|
@@ -86,7 +110,7 @@ state.validate! # => #<Assertion::InvalidError @messages=["John is a child yet (
|
|
86
110
|
Inversion
|
87
111
|
---------
|
88
112
|
|
89
|
-
Use the `.not` *class* method to
|
113
|
+
Use the `.not` *class* method to invert the assertion:
|
90
114
|
|
91
115
|
```ruby
|
92
116
|
jack = { name: 'Jack', age: 21, gender: :male }
|
@@ -95,6 +119,16 @@ IsAdult.not[jack]
|
|
95
119
|
# => #<Assertion::State @state=false, @messages=["Jack is already an adult (age 21)"]>
|
96
120
|
```
|
97
121
|
|
122
|
+
You can also use `!` alias to provide the inversion:
|
123
|
+
|
124
|
+
```ruby
|
125
|
+
IsChild = !IsAdult
|
126
|
+
IsChild[jack]
|
127
|
+
# => #<Assertion::State @state=false, @messages=["Jack is already an adult (age 21)"]>
|
128
|
+
```
|
129
|
+
|
130
|
+
Notice that `!IsAdult[jack]` wouldn't work. Use either `IsAdult.not[jack]`, or `(!IsAdult)[jack]`.
|
131
|
+
|
98
132
|
Composition
|
99
133
|
-----------
|
100
134
|
|
@@ -116,7 +150,7 @@ en:
|
|
116
150
|
falsey: "%{name} is a female"
|
117
151
|
```
|
118
152
|
|
119
|
-
Use method `&` (or its
|
153
|
+
Use method `&` (or its alias `+`) to compose assertion states:
|
120
154
|
|
121
155
|
```ruby
|
122
156
|
jane = { name: 'Jane', age: 16, gender: :female }
|
@@ -142,7 +176,7 @@ class VoterOnly < Assertion::Guard
|
|
142
176
|
end
|
143
177
|
```
|
144
178
|
|
145
|
-
Or using the
|
179
|
+
Or using the builder `Assertion.guards`:
|
146
180
|
|
147
181
|
```ruby
|
148
182
|
VoterOnly = Assertion.guards :user do
|
data/Rakefile
CHANGED
data/lib/assertion/base.rb
CHANGED
@@ -89,7 +89,9 @@ module Assertion
|
|
89
89
|
# @return [String]
|
90
90
|
#
|
91
91
|
def message(state = nil)
|
92
|
-
|
92
|
+
msg = state ? :truthy : :falsey
|
93
|
+
return public_send(msg) if respond_to? msg
|
94
|
+
self.class.translate(msg, attributes)
|
93
95
|
end
|
94
96
|
|
95
97
|
# Calls the assertion checkup and returns the resulting state
|
@@ -25,13 +25,26 @@ module Assertion
|
|
25
25
|
alias_method name, :object
|
26
26
|
end
|
27
27
|
|
28
|
-
|
28
|
+
private
|
29
|
+
|
30
|
+
# Ensures the `#object` is defined
|
31
|
+
#
|
32
|
+
# @param [Class] klass
|
33
|
+
#
|
34
|
+
# @return [undefined]
|
35
|
+
#
|
29
36
|
def self.extended(klass)
|
30
37
|
klass.__send__ :attr_reader, :object
|
31
38
|
end
|
32
39
|
|
33
|
-
|
34
|
-
|
40
|
+
# Checks if alias name for `#object` is free
|
41
|
+
#
|
42
|
+
# @param [#to_sym] key
|
43
|
+
#
|
44
|
+
# @return [undefined]
|
45
|
+
#
|
46
|
+
# @raise [NameError] if the key is already in use
|
47
|
+
#
|
35
48
|
def __check_attribute__(key)
|
36
49
|
return unless (instance_methods << :state).include? key.to_sym
|
37
50
|
fail NameError.new "#{self}##{key} is already defined"
|
@@ -39,8 +39,8 @@ module Assertion
|
|
39
39
|
|
40
40
|
def __add_attribute__(name)
|
41
41
|
__check_attribute__(name)
|
42
|
-
define_method(name) { attributes
|
43
|
-
attributes << name
|
42
|
+
define_method(name) { attributes.fetch(name) }
|
43
|
+
attributes << name
|
44
44
|
end
|
45
45
|
|
46
46
|
def __check_attribute__(name)
|
data/lib/assertion/guard.rb
CHANGED
@@ -35,6 +35,12 @@ module Assertion
|
|
35
35
|
extend DSL::Attribute
|
36
36
|
extend DSL::Caller
|
37
37
|
|
38
|
+
# @!attribute [r] object
|
39
|
+
#
|
40
|
+
# @return [Object] The object to be guarded
|
41
|
+
#
|
42
|
+
attr_reader :object
|
43
|
+
|
38
44
|
# @!scope class
|
39
45
|
# @!method new(object)
|
40
46
|
# Creates the guard instance for the provided object
|
data/lib/assertion/rspec.rb
CHANGED
@@ -6,17 +6,17 @@
|
|
6
6
|
|
7
7
|
shared_context :assertion_translations do
|
8
8
|
|
9
|
-
def
|
9
|
+
def __locale__
|
10
10
|
defined?(locale) ? locale : :en
|
11
11
|
end
|
12
12
|
|
13
13
|
# allows to skip check for error messages
|
14
|
-
def
|
14
|
+
def __messages__
|
15
15
|
defined?(messages) ? Array[*messages] : nil
|
16
16
|
end
|
17
17
|
|
18
18
|
around do |example|
|
19
|
-
old, I18n.locale = I18n.locale,
|
19
|
+
old, I18n.locale = I18n.locale, __locale__
|
20
20
|
example.run
|
21
21
|
I18n.locale = old
|
22
22
|
end
|
@@ -48,38 +48,38 @@ end # shared context
|
|
48
48
|
shared_examples :validating_attributes do
|
49
49
|
|
50
50
|
# allows to skip `assertion` definition when described_class is defined
|
51
|
-
def
|
51
|
+
def __assertion__
|
52
52
|
defined?(assertion) ? assertion : described_class
|
53
53
|
end
|
54
54
|
|
55
55
|
# allows to skip `valid` definition to test messages only
|
56
|
-
def
|
56
|
+
def __valid__
|
57
57
|
defined?(valid) ? valid : false
|
58
58
|
end
|
59
59
|
|
60
|
-
subject(:state) {
|
60
|
+
subject(:state) { __assertion__[attributes] }
|
61
61
|
|
62
62
|
include_context :assertion_translations
|
63
63
|
|
64
64
|
it "[validates]" do
|
65
|
-
expect(state.valid?).to eql(
|
65
|
+
expect(state.valid?).to eql(__valid__), <<-REPORT.gsub(/.+\|/, "")
|
66
66
|
|
|
67
|
-
|#{
|
67
|
+
|#{__assertion__}[#{attributes.to_s[1..-2]}]
|
68
68
|
|
|
69
|
-
| expected: to be #{
|
69
|
+
| expected: to be #{__valid__ ? "valid" : "invalid"}
|
70
70
|
| got: #{state.valid? ? "valid" : "invalid"}
|
71
71
|
REPORT
|
72
72
|
end
|
73
73
|
|
74
74
|
it "[raises expected message]" do
|
75
|
-
if !
|
75
|
+
if !__valid__ && state.invalid? && __messages__
|
76
76
|
expect(state.messages)
|
77
|
-
.to match_array(
|
77
|
+
.to match_array(__messages__), <<-REPORT.gsub(/.+\|/, "")
|
78
78
|
|
|
79
|
-
|Language: #{
|
80
|
-
|Error messages from #{
|
79
|
+
|Language: #{__locale__.to_s.upcase}
|
80
|
+
|Error messages from #{__assertion__}[#{attributes.to_s[1..-2]}]
|
81
81
|
|
|
82
|
-
| expected: #{
|
82
|
+
| expected: #{__messages__.inspect}
|
83
83
|
| got: #{state.messages.inspect}
|
84
84
|
REPORT
|
85
85
|
end
|
@@ -102,12 +102,12 @@ end # shared examples
|
|
102
102
|
shared_examples :accepting_object do
|
103
103
|
|
104
104
|
# allows to skip `guard` definition when described_class is defined
|
105
|
-
def
|
105
|
+
def __guard__
|
106
106
|
defined?(guard) ? guard : described_class
|
107
107
|
end
|
108
108
|
|
109
109
|
# allows to skip `valid` definition to test messages only
|
110
|
-
def
|
110
|
+
def __accepted__
|
111
111
|
defined?(accepted) ? accepted : false
|
112
112
|
end
|
113
113
|
|
@@ -116,11 +116,11 @@ shared_examples :accepting_object do
|
|
116
116
|
include_context :assertion_translations
|
117
117
|
|
118
118
|
it "[guards]" do
|
119
|
-
if
|
119
|
+
if __accepted__
|
120
120
|
expect { checkup }
|
121
121
|
.not_to raise_error, <<-REPORT.gsub(/.+\|/, "")
|
122
122
|
|
|
123
|
-
|#{
|
123
|
+
|#{__guard__}[#{object.inspect}]
|
124
124
|
|
|
125
125
|
| expected: #{object.inspect}
|
126
126
|
| got: #{begin; checkup; rescue => err; err.inspect; end}
|
@@ -129,7 +129,7 @@ shared_examples :accepting_object do
|
|
129
129
|
expect { checkup }
|
130
130
|
.to raise_error(Assertion::InvalidError), <<-REPORT.gsub(/.+\|/, "")
|
131
131
|
|
|
132
|
-
|#{
|
132
|
+
|#{__guard__}[#{object.inspect}]
|
133
133
|
|
|
134
134
|
| expected: #<Assertion::InvalidError>
|
135
135
|
| got: #{object.inspect}
|
@@ -139,15 +139,15 @@ shared_examples :accepting_object do
|
|
139
139
|
|
140
140
|
it "[raises expected message]" do
|
141
141
|
begin
|
142
|
-
checkup if !
|
142
|
+
checkup if !__accepted__ && __messages__
|
143
143
|
rescue => err
|
144
144
|
expect(err.messages)
|
145
|
-
.to match_array(
|
145
|
+
.to match_array(__messages__), <<-REPORT.gsub(/.+\|/, "")
|
146
146
|
|
|
147
|
-
|Language: #{
|
148
|
-
|Error messages from #{
|
147
|
+
|Language: #{__locale__.to_s.upcase}
|
148
|
+
|Error messages from #{__guard__}[#{object.inspect}]
|
149
149
|
|
|
150
|
-
| expected: #{
|
150
|
+
| expected: #{__messages__.inspect}
|
151
151
|
| got: #{err.messages.inspect}
|
152
152
|
REPORT
|
153
153
|
end
|
data/lib/assertion/state.rb
CHANGED
data/lib/assertion/translator.rb
CHANGED
@@ -33,22 +33,6 @@ module Assertion
|
|
33
33
|
#
|
34
34
|
ROOT = :assertion
|
35
35
|
|
36
|
-
# The states to be translated with their dictionary names
|
37
|
-
#
|
38
|
-
# @return [Hash<Object => Symbol>]
|
39
|
-
#
|
40
|
-
DICTIONARY = { true => :truthy, false => :falsey }
|
41
|
-
|
42
|
-
# Provides a scope for the class
|
43
|
-
#
|
44
|
-
# @param [Class] klass
|
45
|
-
#
|
46
|
-
# @return [Array<Symbol>]
|
47
|
-
#
|
48
|
-
def self.scope(klass)
|
49
|
-
[ROOT, Inflecto.underscore(klass).to_sym]
|
50
|
-
end
|
51
|
-
|
52
36
|
# @!attribute [r] scope
|
53
37
|
#
|
54
38
|
# @return [Array<Symbol>] the scope for translations
|
@@ -72,7 +56,7 @@ module Assertion
|
|
72
56
|
# @private
|
73
57
|
def initialize(assertion)
|
74
58
|
@assertion = assertion
|
75
|
-
@scope =
|
59
|
+
@scope = "#{ROOT}.#{Inflecto.underscore assertion}"
|
76
60
|
IceNine.deep_freeze(self)
|
77
61
|
end
|
78
62
|
|
@@ -86,7 +70,7 @@ module Assertion
|
|
86
70
|
# @return [String] The translation
|
87
71
|
#
|
88
72
|
def call(state, args = {})
|
89
|
-
I18n.translate
|
73
|
+
I18n.translate state, args.merge(scope: scope)
|
90
74
|
end
|
91
75
|
|
92
76
|
end # class Translator
|
data/lib/assertion/version.rb
CHANGED
@@ -15,22 +15,44 @@ describe Assertion do
|
|
15
15
|
age.to_i >= 18
|
16
16
|
end
|
17
17
|
|
18
|
-
|
18
|
+
class IsCat < Assertion::Base
|
19
|
+
attribute :species, :name
|
20
|
+
|
21
|
+
def check
|
22
|
+
species == :cat
|
23
|
+
end
|
24
|
+
|
25
|
+
def truthy
|
26
|
+
"#{name} is a cat"
|
27
|
+
end
|
28
|
+
|
29
|
+
def falsey
|
30
|
+
"#{name} is not a cat"
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
jane = { name: "Jane", gender: :female, age: 19, species: :human }
|
35
|
+
john = { name: "John", gender: :male, age: 9, species: :cat }
|
19
36
|
|
20
|
-
jane_is_a_male = IsMale[jane]
|
21
37
|
jane_is_a_female = IsMale.not[jane]
|
22
38
|
jane_is_an_adult = IsAdult[jane]
|
23
|
-
jane_is_a_child = IsAdult.not[jane]
|
24
|
-
|
25
39
|
jane_is_a_women = jane_is_a_female & jane_is_an_adult
|
26
40
|
expect(jane_is_a_women).to be_valid
|
27
41
|
expect { jane_is_a_women.validate! }.not_to raise_error
|
28
42
|
|
43
|
+
jane_is_a_male = IsMale[jane]
|
44
|
+
jane_is_a_child = IsAdult.not[jane]
|
29
45
|
jane_is_a_boy = jane_is_a_male & jane_is_a_child
|
30
46
|
expect(jane_is_a_boy).not_to be_valid
|
31
47
|
expect(jane_is_a_boy.messages)
|
32
48
|
.to eql ["Jane is a female", "Jane is an adult (age 19)"]
|
33
49
|
expect { jane_is_a_boy.validate! }.to raise_error Assertion::InvalidError
|
50
|
+
|
51
|
+
jane_is_a_cat = IsCat[jane]
|
52
|
+
expect(jane_is_a_cat.messages).to eql ["Jane is not a cat"]
|
53
|
+
|
54
|
+
john_is_not_a_cat = IsCat.not[john]
|
55
|
+
expect(john_is_not_a_cat.messages).to eql ["John is a cat"]
|
34
56
|
end
|
35
57
|
|
36
58
|
after do
|
@@ -19,7 +19,7 @@ describe Assertion::Base do
|
|
19
19
|
|
20
20
|
describe ".new" do
|
21
21
|
|
22
|
-
let(:klass) { Class.new(described_class) { attribute :foo,
|
22
|
+
let(:klass) { Class.new(described_class) { attribute :foo, "bar" } }
|
23
23
|
|
24
24
|
context "with attributes" do
|
25
25
|
|
@@ -67,7 +67,8 @@ describe Assertion::Base do
|
|
67
67
|
end
|
68
68
|
|
69
69
|
it "returns a translation" do
|
70
|
-
|
70
|
+
msg = options[:as] ? :truthy : :falsey
|
71
|
+
expect(subject).to eql translator.call(msg, attributes)
|
71
72
|
end
|
72
73
|
|
73
74
|
end # shared examples
|
@@ -84,6 +85,18 @@ describe Assertion::Base do
|
|
84
85
|
subject { assertion.message }
|
85
86
|
end
|
86
87
|
|
88
|
+
context "when #truthy and #falsey defined" do
|
89
|
+
|
90
|
+
before { klass.send(:define_method, :truthy) { "foo" } }
|
91
|
+
before { klass.send(:define_method, :falsey) { "bar" } }
|
92
|
+
|
93
|
+
it "uses defined method" do
|
94
|
+
expect(assertion.message(true)).to eql "foo"
|
95
|
+
expect(assertion.message(false)).to eql "bar"
|
96
|
+
end
|
97
|
+
|
98
|
+
end # context
|
99
|
+
|
87
100
|
end # describe #message
|
88
101
|
|
89
102
|
describe "#call" do
|
@@ -13,6 +13,17 @@ describe Assertion::DSL::Inversion do
|
|
13
13
|
expect(subject.source).to eql klass
|
14
14
|
end
|
15
15
|
|
16
|
-
end # describe
|
16
|
+
end # describe #not
|
17
|
+
|
18
|
+
describe "#!" do
|
19
|
+
|
20
|
+
subject { !klass }
|
21
|
+
|
22
|
+
it "creates the iverter for the current class" do
|
23
|
+
expect(subject).to be_kind_of Assertion::Inverter
|
24
|
+
expect(subject.source).to eql klass
|
25
|
+
end
|
26
|
+
|
27
|
+
end # describe #!
|
17
28
|
|
18
29
|
end # describe Assertion::DSL::Inversion
|
@@ -20,13 +20,6 @@ describe Assertion::Translator do
|
|
20
20
|
|
21
21
|
end # describe #assertion
|
22
22
|
|
23
|
-
describe "#scope" do
|
24
|
-
|
25
|
-
subject { translator.scope }
|
26
|
-
it { is_expected.to eql [:assertion, :is_foo] }
|
27
|
-
|
28
|
-
end # describe #scope
|
29
|
-
|
30
23
|
describe "#call" do
|
31
24
|
|
32
25
|
shared_examples "translating" do |input, opts|
|
@@ -49,10 +42,8 @@ describe Assertion::Translator do
|
|
49
42
|
|
50
43
|
end # shared examples
|
51
44
|
|
52
|
-
it_behaves_like "translating",
|
53
|
-
it_behaves_like "translating",
|
54
|
-
it_behaves_like "translating", false, to: "falsey"
|
55
|
-
it_behaves_like "translating", nil, to: "falsey"
|
45
|
+
it_behaves_like "translating", :truthy, to: "truthy"
|
46
|
+
it_behaves_like "translating", :falsey, to: "falsey"
|
56
47
|
|
57
48
|
end # describe #call
|
58
49
|
|
metadata
CHANGED
@@ -1,83 +1,83 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: assertion
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kozin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: i18n
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0.7'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0.7'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: ice_nine
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0.11'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0.11'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: inflecto
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - ~>
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0.0'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - ~>
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: hexx-rspec
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - ~>
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0.5'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - ~>
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0.5'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: equalizer
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - ~>
|
73
|
+
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0.0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - ~>
|
80
|
+
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0.0'
|
83
83
|
description:
|
@@ -88,13 +88,13 @@ extra_rdoc_files:
|
|
88
88
|
- README.md
|
89
89
|
- LICENSE
|
90
90
|
files:
|
91
|
-
- .coveralls.yml
|
92
|
-
- .gitignore
|
93
|
-
- .metrics
|
94
|
-
- .rspec
|
95
|
-
- .rubocop.yml
|
96
|
-
- .travis.yml
|
97
|
-
- .yardopts
|
91
|
+
- ".coveralls.yml"
|
92
|
+
- ".gitignore"
|
93
|
+
- ".metrics"
|
94
|
+
- ".rspec"
|
95
|
+
- ".rubocop.yml"
|
96
|
+
- ".travis.yml"
|
97
|
+
- ".yardopts"
|
98
98
|
- CHANGELOG.md
|
99
99
|
- Gemfile
|
100
100
|
- Guardfile
|
@@ -158,12 +158,12 @@ require_paths:
|
|
158
158
|
- lib
|
159
159
|
required_ruby_version: !ruby/object:Gem::Requirement
|
160
160
|
requirements:
|
161
|
-
- - ~>
|
161
|
+
- - "~>"
|
162
162
|
- !ruby/object:Gem::Version
|
163
163
|
version: '1.9'
|
164
164
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
165
165
|
requirements:
|
166
|
-
- -
|
166
|
+
- - ">="
|
167
167
|
- !ruby/object:Gem::Version
|
168
168
|
version: '0'
|
169
169
|
requirements: []
|