lib/spec/rails/example/assigns_hash_proxy.rb in dchelimsky-rspec-rails-1.1.7 vs lib/spec/rails/example/assigns_hash_proxy.rb in dchelimsky-rspec-rails-1.1.8
- old
+ new
@@ -6,18 +6,21 @@
@target = block.call
@example_group = example_group
end
def [](key)
+ return false if assigns[key] == false
+ return false if assigns[key.to_s] == false
assigns[key] || assigns[key.to_s] || @target.instance_variable_get("@#{key}")
end
def []=(key, val)
@target.instance_variable_set("@#{key}", val)
end
def delete(key)
assigns.delete(key.to_s)
+ @target.instance_variable_set("@#{key}", nil)
end
def each(&block)
assigns.each &block
end