Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save nbfritz/5362726 to your computer and use it in GitHub Desktop.
This test should fail every time. But note the random numbers it fails with when running standalone and through spork.
require 'spec_helper'
describe 'Random numbers' do
it 'fails every time' do
numbers = 10.times.map { rand(100) }
numbers.join(', ').should eq 'the Tardis'
end
end
require 'rubygems'
require 'rspec'
require 'spork'
Spork.prefork do
RSpec.configure do |config|
config.treat_symbols_as_metadata_keys_with_true_values = true
config.run_all_when_everything_filtered = true
config.order = 'random'
end
end
Spork.each_run do
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment