Skip to content

Instantly share code, notes, and snippets.

@olivierlacan
Created April 11, 2016 15:40
Show Gist options
  • Save olivierlacan/d1ae70b39de9f0d4b300c920ba015bea to your computer and use it in GitHub Desktop.
Save olivierlacan/d1ae70b39de9f0d4b300c920ba015bea to your computer and use it in GitHub Desktop.
Do you really know how RSpec filters work?
require "spec_helper"
describe "Testing Filters" do
before(:all) { puts "In the beginning!" }
before(:each) { puts "1" }
around do |example|
puts "get around"
example.run
puts "after get around"
end
context "whatever" do
before(:each) { puts "whatever" }
it "first ex thingie" do
puts "first shit happening and testing"
end
it "second ex thingie" do
puts "second shit happening and testing"
end
end
after(:each) { puts "99" }
after(:all) { puts "That's all folks" }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment