Skip to content

Commit

Permalink
Start with a failing command line spec.
Browse files Browse the repository at this point in the history
  • Loading branch information
justinko committed Oct 14, 2011
1 parent 392862f commit e67e920
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions spec/command_line/order_spec.rb
@@ -0,0 +1,30 @@
require 'spec_helper'

describe 'command line' do
describe '--order' do
context 'given "random"' do
before do
write_file 'spec/sample_spec.rb', %Q|
describe 'example' do
specify('one') { fail }
specify('two') { fail }
end
|
end

let(:first_failures) do
5.times.map do
run_simple 'rspec spec --order random', false
all_output =~ /1\) example (one|two)/
$&
end
end

it 'runs the examples in random order' do
first_failures.uniq.should =~ [
'1 ) example one', '1 ) example two'
]
end
end
end
end

0 comments on commit e67e920

Please sign in to comment.