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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fe0cc8adcc9dcbf0abde793aa42bf497b5cc8efe
4
- data.tar.gz: ddad652df3ae20eace8ef0f05e76150f5fb36a4a
3
+ metadata.gz: 34aa2f840ecab85c20a3a6a75f1758bc3734eb5e
4
+ data.tar.gz: 23a353b9e6d5441145c9efc4509cde3d9c1293c3
5
5
  SHA512:
6
- metadata.gz: 5993e35ad333303a9d75140fd48d6d7fb1519a10f9f99179a9aa0e3e2ca661b7d088ff0ea0775b4c861ed7bca66a7002940e3585db8149893e8ddb088619e522
7
- data.tar.gz: e97c3c5d18443b1946876e4d56a074b72543c48cfe92b11fb5b7f99f7c23fefa32a9899508fa10e2476e16a2482c44b0ad2b10b4ce948363940f90934c4266f0
6
+ metadata.gz: f9eca2a62694b726972bfcba44bcdd781117001e7a60080ba7c578ba2c50cdc98fba76034f30fec035546caa40c6eae6761be6634ac31a5dde14b692c1b67e88
7
+ data.tar.gz: 70780de5e069055e1f326db722efb00fda2573b5fbe35d7780bab70ff80e17e55bfadc66baa100a0863b90c9c474b7b4405ab99a6013438ffbb79e5c6148d037
@@ -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.12"
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"]
@@ -20,7 +20,7 @@ module Less
20
20
  end
21
21
  nils.merge(options).each do |name, value|
22
22
  instance_variable_set "@#{name}", value
23
- if respond_to? "#{name}="
23
+ if respond_to?( "#{name}=" ) && !value.nil?
24
24
  send "#{name}=", value
25
25
  end
26
26
  end
@@ -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)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: less_interactions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eugen Minciu