Skip to content

Commit

Permalink
Add specs for --order config methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
justinko committed Oct 24, 2011
1 parent 3c7cd42 commit 1f68e25
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions spec/rspec/core/configuration_spec.rb
Expand Up @@ -937,5 +937,37 @@ def metadata_hash(*args)
end
end
end

describe '#randomize?' do
context 'with order set to :random' do
before { config.order = :random }

it 'returns true' do
config.randomize?.should be_true
end
end

context 'with order set to nil' do
before { config.order = nil }

it 'returns false' do
config.randomize?.should be_false
end
end
end

describe '#orderby=' do
context 'given "random:123"' do
before { config.orderby = 'random:123' }

it 'sets order to "random"' do
config.order.should eq('random')
end

it 'sets seed to 123' do
config.seed.should eq(123)
end
end
end
end
end

0 comments on commit 1f68e25

Please sign in to comment.