less_interactions 0.0.12 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/less_interactions.gemspec +1 -1
- data/lib/less_interactions/interaction.rb +1 -1
- data/test/interaction_test.rb +14 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34aa2f840ecab85c20a3a6a75f1758bc3734eb5e
|
4
|
+
data.tar.gz: 23a353b9e6d5441145c9efc4509cde3d9c1293c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f9eca2a62694b726972bfcba44bcdd781117001e7a60080ba7c578ba2c50cdc98fba76034f30fec035546caa40c6eae6761be6634ac31a5dde14b692c1b67e88
|
7
|
+
data.tar.gz: 70780de5e069055e1f326db722efb00fda2573b5fbe35d7780bab70ff80e17e55bfadc66baa100a0863b90c9c474b7b4405ab99a6013438ffbb79e5c6148d037
|
data/less_interactions.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{less_interactions}
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.13"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Eugen Minciu", "Steven Bristol"]
|
data/test/interaction_test.rb
CHANGED
@@ -25,6 +25,7 @@ class InteractionTest < Test::Unit::TestCase
|
|
25
25
|
|
26
26
|
should "call init when running an interaction with an init method" do
|
27
27
|
class InteractionExpectingInit2 < Interaction
|
28
|
+
expects :a, allow_nil: true
|
28
29
|
def run; self; end
|
29
30
|
def init; @a = 1; end
|
30
31
|
end
|
@@ -34,6 +35,7 @@ class InteractionTest < Test::Unit::TestCase
|
|
34
35
|
|
35
36
|
should "call the writer if there is one" do
|
36
37
|
class InteractionWithWriter < Interaction
|
38
|
+
expects :a, allow_nil: true
|
37
39
|
def run; self; end
|
38
40
|
def a= val; @a += 1; end
|
39
41
|
end
|
@@ -41,6 +43,18 @@ class InteractionTest < Test::Unit::TestCase
|
|
41
43
|
assert_equal 2, i.instance_variable_get(:@a)
|
42
44
|
end
|
43
45
|
|
46
|
+
should "call the writer if there is one and value is not null" do
|
47
|
+
class GobbledyGook; def gobble; "gook"; end; end
|
48
|
+
class InteractionWithWriter < Interaction
|
49
|
+
expects :a, allow_nil: true
|
50
|
+
def run; self; end
|
51
|
+
def a= val; @a = val.gobble; end
|
52
|
+
end
|
53
|
+
i = InteractionWithWriter.run
|
54
|
+
i.a = GobbledyGook.new
|
55
|
+
assert_equal "gook", i.instance_variable_get(:@a)
|
56
|
+
end
|
57
|
+
|
44
58
|
should "call the run instance method when running an interaction" do
|
45
59
|
class InteractionExpectingRun < Interaction; end
|
46
60
|
InteractionExpectingRun.any_instance.expects(:run)
|