Skip to content

Instantly share code, notes, and snippets.

@pdg137
Forked from anonymous/rspec and local variables
Created December 5, 2013 19:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pdg137/7812708 to your computer and use it in GitHub Desktop.
Save pdg137/7812708 to your computer and use it in GitHub Desktop.
describe "rspec" do
context "using .each" do
[1,2].each do |x|
let(:y) { x }
specify "#{x} == #{x}" do
y.should == x
end
end
end
a = 1
let(:b) { a }
specify "#{a} == #{a}" do
b.should == a
end
a = 2
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment