Skip to content

Instantly share code, notes, and snippets.

@nbfritz
Last active December 16, 2015 01:19
Show Gist options
  • Select an option

  • Save nbfritz/5353803 to your computer and use it in GitHub Desktop.

Select an option

Save nbfritz/5353803 to your computer and use it in GitHub Desktop.
This is a horribly contrived example of a set of specs that only pass if run in the order they're presented. They'll fail if run in the opposite order.
require 'spec_helper'
describe 'unintended sequence' do
before(:all) do
@x = {a: 1, b: 2}
end
it 'modifies the array' do
@x[:a] = 2
@x[:a].should eq 2
end
it 'checks the array' do
@x[:a].should eq 2
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment