Created
July 30, 2012 19:21
-
-
Save adilsoncarvalho/3209340 to your computer and use it in GitHub Desktop.
Checking the order Sinatra fire the before events on a request
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
#!/usr/bin/env ruby | |
require 'sinatra' | |
before do | |
@my_value = 'Adilson' | |
end | |
before do | |
@my_value = "#{@my_value} Carvalho" | |
end | |
get '/test' do | |
@my_value # as expected, it returns 'Adilson Carvalho'... it fires on the same order the events were added | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment