daberu 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -15,3 +15,5 @@ spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
+ *.swp
19
+ *~
@@ -24,6 +24,14 @@ module Daberu
24
24
  obj.__daberu_format_set__(str)
25
25
  end
26
26
 
27
+ def self.object_get(obj)
28
+ obj.__daberu_object_get__
29
+ end
30
+
31
+ def self.object_set(obj, new)
32
+ obj.__daberu_object_set__(new)
33
+ end
34
+
27
35
  def __daberu_format_get__
28
36
  @format
29
37
  end
@@ -31,6 +39,14 @@ module Daberu
31
39
  def __daberu_format_set__(str)
32
40
  @format = str
33
41
  end
42
+
43
+ def __daberu_object_get__
44
+ @obj
45
+ end
46
+
47
+ def __daberu_object_set__(obj)
48
+ @obj = obj
49
+ end
34
50
  end
35
51
  end
36
52
 
@@ -1,3 +1,3 @@
1
1
  module Daberu
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -82,5 +82,28 @@ describe Daberu::Talker do
82
82
  $stdout = STDOUT
83
83
  Daberu::Talker.format_get(d).should == "Class: %s, Method: %s, Arguments: [%s], Block: %s"
84
84
  end
85
+
86
+ it "is get to inner object" do
87
+ t = Tempfile.open("daberu")
88
+ $stdout = File.open(t, "w")
89
+ obj = Object.new
90
+ d = Daberu::Talker.new(obj)
91
+ $stdout.flush
92
+ $stdout = STDOUT
93
+ Daberu::Talker.object_get(d).should == obj
94
+ end
95
+
96
+ it "is set to inner object" do
97
+ t = Tempfile.open("daberu")
98
+ $stdout = File.open(t, "w")
99
+ obj1 = Object.new
100
+ d = Daberu::Talker.new(obj1)
101
+ $stdout.flush
102
+ $stdout = STDOUT
103
+ obj2 = Object.new
104
+ Daberu::Talker.object_set(d, obj2)
105
+ Daberu::Talker.object_get(d).should_not == obj1
106
+ Daberu::Talker.object_get(d).should == obj2
107
+ end
85
108
  end
86
109
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: daberu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-08 00:00:00.000000000 Z
12
+ date: 2012-09-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake