Reorder constructor to avoid referencing uninitialized variable when environment contains a self-referencing proc

This commit is contained in:
Jason Hiltz-Laforge
2014-07-24 18:58:23 +00:00
parent d07b12dc7d
commit 052ef9fcb8
2 changed files with 14 additions and 6 deletions
+8
View File
@@ -483,4 +483,12 @@ class ContextUnitTest < Test::Unit::TestCase
assert_equal 1, mock_scan.calls.size
end
def test_context_initialization_with_a_proc_in_environment
contx = Context.new([:test => lambda { |c| c['poutine']}], {:test => :foo})
assert contx
assert_nil contx['poutine']
end
end # ContextTest