brassbound-dci 0.5.2 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -121,12 +121,10 @@ module Brassbound::Context
121
121
  role_mapping = self.roles[role_name]
122
122
  role_module, obj = role_mapping.role_module, role_mapping.data_object
123
123
  obj.instance_variable_set(:@__brassbound_context, nil)
124
- class << obj
125
- remove_method(:context)
126
- end
127
124
  role_module.instance_methods.each do |m|
128
125
  obj.singleton_class.send(:undef_method, m)
129
126
  end
127
+ obj.singleton_class.send(:undef_method, :context) if obj.respond_to?(:context)
130
128
  self.singleton_class.send(:undef_method, role_name)
131
129
  end
132
130
 
@@ -1,3 +1,3 @@
1
1
  module Brassbound
2
- VERSION = "0.5.2"
2
+ VERSION = "0.5.3"
3
3
  end
data/spec/context_spec.rb CHANGED
@@ -86,5 +86,12 @@ describe Context do
86
86
  end
87
87
  end
88
88
  end
89
+
90
+ it "removes all bindings after execution" do
91
+ role MoneySource, source_account
92
+ role MoneySink, source_account # yes, that is intentional
93
+ in_context do 'nothing' end
94
+ source_account.should_not respond_to(:context)
95
+ end
89
96
  end
90
97
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brassbound-dci
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-14 00:00:00.000000000 Z
12
+ date: 2012-05-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &70188456933260 !ruby/object:Gem::Requirement
16
+ requirement: &70258690829500 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: 2.10.0
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70188456933260
24
+ version_requirements: *70258690829500
25
25
  description: Brassbound is a simple but strict implementation of the Data, Context,
26
26
  and Interaction (DCI) paradigm for Ruby.
27
27
  email: