Skip to content

Commit

Permalink
few more enlightening tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
bsodmike committed Sep 8, 2011
1 parent db594e1 commit c160ee8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
10 changes: 9 additions & 1 deletion koans/about_control_statements.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,20 @@ def test_if_statement_modifiers

def test_unless_statement
result = :default_value
unless false
unless false # same as saying 'if !false', which evaluates as 'if true'
result = :false_value
end
assert_equal __, result
end

def test_unless_statement_evaluate_true
result = :default_value
unless true # same as saying 'if !true', which evaluates as 'if false'
result = :true_value
end
assert_equal __, result
end

def test_unless_statement_modifier
result = :default_value
result = :false_value unless false
Expand Down
1 change: 1 addition & 0 deletions koans/about_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def method_with_var_args(*args)
end

def test_calling_with_variable_arguments
assert_equal __, method_with_var_args.class
assert_equal __, method_with_var_args
assert_equal __, method_with_var_args(:one)
assert_equal __, method_with_var_args(:one, :two)
Expand Down

0 comments on commit c160ee8

Please sign in to comment.