<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -61,7 +61,7 @@ module Spec
                                              &quot;If this option is used it must come before the others&quot;],
         :backtrace =&gt; [&quot;-b&quot;, &quot;--backtrace&quot;, &quot;Output full backtrace&quot;],
         :loadby =&gt; [&quot;-L&quot;, &quot;--loadby STRATEGY&quot;, &quot;Specify the strategy by which spec files should be loaded.&quot;,
-                                               &quot;STRATEGY can currently only be 'mtime' (File modification time)&quot;,
+                                               &quot;STRATEGY can currently be 'mtime' (File modification time) or random&quot;,
                                                &quot;By default, spec files are loaded in alphabetical order if --loadby&quot;,
                                                &quot;is not specified.&quot;],
         :reverse =&gt; [&quot;-R&quot;, &quot;--reverse&quot;, &quot;Run examples in reverse order&quot;],</diff>
      <filename>rspec/lib/spec/runner/option_parser.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,7 +2,8 @@ module Spec
   module Runner
     class Options
       FILE_SORTERS = {
-        'mtime' =&gt; lambda {|file_a, file_b| File.mtime(file_b) &lt;=&gt; File.mtime(file_a)}
+        'mtime' =&gt; lambda {|file_a, file_b| File.mtime(file_b) &lt;=&gt; File.mtime(file_a)},
+       'random' =&gt; lambda {|file_a, file_b| rand &lt;=&gt; rand }
       }
 
       EXAMPLE_FORMATTERS = { # Load these lazily for better speed</diff>
      <filename>rspec/lib/spec/runner/options.rb</filename>
    </modified>
    <modified>
      <diff>@@ -355,6 +355,23 @@ describe &quot;OptionParser&quot; do
     end
   end
   
+  it &quot;should accept the random comparator when --loadby random&quot; do
+    options = parse([&quot;--loadby&quot;, &quot;random&quot;])
+    options.class.should_receive(:rand).and_return(0.2, 0.1)
+
+    runner = Spec::Runner::ExampleGroupRunner.new(options)
+    Spec::Runner::ExampleGroupRunner.should_receive(:new).
+      with(options).
+      and_return(runner)
+    runner.should_receive(:load_files).with([&quot;option_parser_spec.rb&quot;, &quot;command_line_spec.rb&quot;])
+    
+    Dir.chdir(File.dirname(__FILE__)) do
+      options.files &lt;&lt; 'command_line_spec.rb'
+      options.files &lt;&lt; 'option_parser_spec.rb'
+      options.run_examples
+    end
+  end
+  
   it &quot;should use the standard runner by default&quot; do
     runner = ::Spec::Runner::ExampleGroupRunner.new(@parser.options)
     ::Spec::Runner::ExampleGroupRunner.should_receive(:new).</diff>
      <filename>rspec/spec/spec/runner/option_parser_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>cd2176712f8575d1e69f29a9a315f707074f7cd5</id>
    </parent>
  </parents>
  <author>
    <name>Sean Geoghegan</name>
    <email>seangeo@gmail.com</email>
  </author>
  <url>http://github.com/seangeo/rspec/commit/b7520eac216d6c26bdd3f0154260212944252911</url>
  <id>b7520eac216d6c26bdd3f0154260212944252911</id>
  <committed-date>2008-04-02T02:14:36-07:00</committed-date>
  <authored-date>2008-04-02T02:09:42-07:00</authored-date>
  <message>Added --loadby random option that randomizes the test order.</message>
  <tree>455db6daa883032155d508329ab2a5c3f8366f89</tree>
  <committer>
    <name>Sean Geoghegan</name>
    <email>seangeo@gmail.com</email>
  </committer>
</commit>
