Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/configatron/proc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def call
@val = val
end
end
return val || @val
return val.nil? ? @val : val
end

def finalize?
Expand Down
6 changes: 6 additions & 0 deletions test/unit/configatron/proc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,11 @@ class Critic::Unit::ProcTest < Critic::Unit::Test
@proc.stubs(:finalize?).returns(false)
refute_equal(@proc.call, @proc.call)
end

it 'sets and returns false in Dynamic' do
stubs(:rand).returns(false)
@proc.stubs(:finalize?).returns(false)
assert_equal(false, @proc.call)
end
end
end