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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 589d8a1f649094a7a7f76534dcbda6495e41bc3f
4
- data.tar.gz: 97ea6decb78ab17122f24afefda6f552ac2b114a
3
+ metadata.gz: 7966a3455111995cd6d5edf92f083cfea9c12ffe
4
+ data.tar.gz: 346d68da34d246ec00c1a129bb436a6ceb60f15b
5
5
  SHA512:
6
- metadata.gz: 106a58c5e4d7ece5c30f470917b86654eefb1c400326f5b45bd7ce2f5a12742af0e87a4e79d334673204427e87d711608e33d2bf015cd3e1d19c37aabd5e83eb
7
- data.tar.gz: dfd94bdadbf507cdc1d1b5397a427b7bff23d3feed9face5b4b4963924705a9c260619b9b1847151786078344f780376163a686892f96725df9f727d18a71415
6
+ metadata.gz: c503de87793c34510b687adcc25ada3c88cb35281e27a175836dafdbc80746cb65e177fac60b55d1de0cb0447b46b39c178a6eeaf239a76c85ede669ef24e1e9
7
+ data.tar.gz: 1da532d1dfce1f75c380bf385faf43dce565fe1612276dabf5bb76be4083ae35b93e76d695ff45a451f19ebefaccf48ea5cf7ae2d4b584ce83c623f7b21d9313
@@ -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.define_singleton_method(:success?) { false }
8
- cls.define_singleton_method(:failure?) { true }
7
+ cls.send(:define_method, :success?) { false }
8
+ cls.send(:define_method, :failure?) { true }
9
9
  end
10
10
  end
11
11
  end
@@ -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.define_singleton_method(:success?) { true }
8
- cls.define_singleton_method(:failure?) { false }
7
+ cls.send(:define_method, :success?) { true }
8
+ cls.send(:define_method, :failure?) { false }
9
9
  end
10
10
  end
11
11
  end
@@ -1,3 +1,3 @@
1
1
  module Rohbau
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
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(:subject) { Rohbau::Failure.new }
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 subject.ancestors, Bound::StaticBoundClass
9
+ assert_includes cls.ancestors, Bound::StaticBoundClass
9
10
  end
10
11
 
11
12
  it 'is a failure' do
12
- assert_equal true, subject.failure?
13
+ assert_equal true, instance.failure?
13
14
  end
14
15
 
15
16
  it 'is no success' do
16
- assert_equal false, subject.success?
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(:subject) { Rohbau::Success.new }
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 subject.ancestors, Bound::StaticBoundClass
9
+ assert_includes cls.ancestors, Bound::StaticBoundClass
9
10
  end
10
11
 
11
12
  it 'is a success' do
12
- assert_equal true, subject.success?
13
+ assert_equal true, instance.success?
13
14
  end
14
15
 
15
16
  it 'is no failure' do
16
- assert_equal false, subject.failure?
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.1
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-17 00:00:00.000000000 Z
15
+ date: 2016-06-20 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: thread_safe