title: Equivalence between ifs and forms of case statements in Ruby
body: <p>Using the ruby_parser and Ruby2Ruby gems, I'm writing code that keeps track of what conditions have been evaluated and what their results and parameters were. In order to keep this as simple as possible, I sometimes rewrite the AST a bit. Of course, I can only do that if I'm sure the result functions exactly the same as the original.</p>
  
  <p>Am I correct in asserting that the following three Ruby snippets are equivalent in function, assuming the triple dots are replaced by a valid Ruby expression? Am I overlooking any edge cases?</p>
  
  <pre><code>case var
    when foo 
      something
    when ... 
      another_thing
    else 
      something_else
  end
  
  if foo === var 
    something
  elsif ... === var
    another_thing
  else  
    something_else
  end
  
  case
    when foo === var 
      something
    when ... === var 
      another_thing
    else 
      something_else
  end
  </code></pre>