Created
November 26, 2009 10:43
-
-
Save rlivsey/243386 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
class ThingsController < ApplicationController | |
def index | |
puts defined?(@something) | |
puts @something | |
@something = "test" | |
render :text => 'done' | |
end | |
end |
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
# expected output for each spec | |
# ----------------------------- | |
# nil | |
# nil | |
# nil | |
# nil | |
describe ThingsController do | |
describe "test" do | |
# actual output | |
# ------------- | |
# nil | |
# nil | |
# "instance-variable" | |
# "already set" | |
it "two requests" do | |
get :index | |
get :index | |
end | |
# actual output | |
# ------------- | |
# nil | |
# nil | |
# "instance-variable" | |
# "already set" | |
it "another two requests" do | |
get :index | |
get :index | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment