rohbau 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rohbau/failure.rb +2 -2
- data/lib/rohbau/success.rb +2 -2
- data/lib/rohbau/version.rb +1 -1
- data/spec/failure_spec.rb +5 -4
- data/spec/success_spec.rb +5 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7966a3455111995cd6d5edf92f083cfea9c12ffe
|
4
|
+
data.tar.gz: 346d68da34d246ec00c1a129bb436a6ceb60f15b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c503de87793c34510b687adcc25ada3c88cb35281e27a175836dafdbc80746cb65e177fac60b55d1de0cb0447b46b39c178a6eeaf239a76c85ede669ef24e1e9
|
7
|
+
data.tar.gz: 1da532d1dfce1f75c380bf385faf43dce565fe1612276dabf5bb76be4083ae35b93e76d695ff45a451f19ebefaccf48ea5cf7ae2d4b584ce83c623f7b21d9313
|
data/lib/rohbau/failure.rb
CHANGED
@@ -4,8 +4,8 @@ module Rohbau
|
|
4
4
|
class Failure < Bound
|
5
5
|
def self.new_bound_class
|
6
6
|
Class.new(StaticBoundClass) do |cls|
|
7
|
-
cls.
|
8
|
-
cls.
|
7
|
+
cls.send(:define_method, :success?) { false }
|
8
|
+
cls.send(:define_method, :failure?) { true }
|
9
9
|
end
|
10
10
|
end
|
11
11
|
end
|
data/lib/rohbau/success.rb
CHANGED
@@ -4,8 +4,8 @@ module Rohbau
|
|
4
4
|
class Success < Bound
|
5
5
|
def self.new_bound_class
|
6
6
|
Class.new(StaticBoundClass) do |cls|
|
7
|
-
cls.
|
8
|
-
cls.
|
7
|
+
cls.send(:define_method, :success?) { true }
|
8
|
+
cls.send(:define_method, :failure?) { false }
|
9
9
|
end
|
10
10
|
end
|
11
11
|
end
|
data/lib/rohbau/version.rb
CHANGED
data/spec/failure_spec.rb
CHANGED
@@ -2,18 +2,19 @@ require 'spec_helper'
|
|
2
2
|
require 'rohbau/failure'
|
3
3
|
|
4
4
|
describe Rohbau::Failure do
|
5
|
-
let(:
|
5
|
+
let(:cls) { Rohbau::Failure.required(:foo) }
|
6
|
+
let(:instance) { cls.new(:foo => 'bar') }
|
6
7
|
|
7
8
|
it 'inherits from Bound' do
|
8
|
-
assert_includes
|
9
|
+
assert_includes cls.ancestors, Bound::StaticBoundClass
|
9
10
|
end
|
10
11
|
|
11
12
|
it 'is a failure' do
|
12
|
-
assert_equal true,
|
13
|
+
assert_equal true, instance.failure?
|
13
14
|
end
|
14
15
|
|
15
16
|
it 'is no success' do
|
16
|
-
assert_equal false,
|
17
|
+
assert_equal false, instance.success?
|
17
18
|
end
|
18
19
|
|
19
20
|
it 'it does not polute Class' do
|
data/spec/success_spec.rb
CHANGED
@@ -2,18 +2,19 @@ require 'spec_helper'
|
|
2
2
|
require 'rohbau/success'
|
3
3
|
|
4
4
|
describe Rohbau::Success do
|
5
|
-
let(:
|
5
|
+
let(:cls) { Rohbau::Success.required(:foo) }
|
6
|
+
let(:instance) { cls.new(:foo => 'bar') }
|
6
7
|
|
7
8
|
it 'inherits from Bound' do
|
8
|
-
assert_includes
|
9
|
+
assert_includes cls.ancestors, Bound::StaticBoundClass
|
9
10
|
end
|
10
11
|
|
11
12
|
it 'is a success' do
|
12
|
-
assert_equal true,
|
13
|
+
assert_equal true, instance.success?
|
13
14
|
end
|
14
15
|
|
15
16
|
it 'is no failure' do
|
16
|
-
assert_equal false,
|
17
|
+
assert_equal false, instance.failure?
|
17
18
|
end
|
18
19
|
|
19
20
|
it 'it does not polute Class' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rohbau
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jakob Holderbaum
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2016-06-
|
15
|
+
date: 2016-06-20 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: thread_safe
|