Created
February 26, 2010 04:16
-
-
Save rafaelss/315393 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# implementacao | |
def metodo_que_gera_uma_url(text_qualquer, params = {}) | |
# ... inicializa algumas coisas | |
query = params.collect { |k, v| "#{k}=#{v}" }.join('&') | |
url << "?#{query}" | |
end | |
# teste | |
assert_equal "http://host_qualquer.com/?a=1&b=2", metodo_que_gera_uma_url("texto", :a => 1, :b => 2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment