skorks / escort

A library that makes building command-line apps in ruby so easy, you'll feel like an expert is guiding you through it

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Spec fails when run randomly but not when run single spec file

thegreyfellow opened this issue · comments

When I run $ rspec ./spec/lib/escort/setup/configuration/locator/chaining_spec.rb everything is green. But when I run the whole spec/lib/escort folder specs I get this result:

$ rspec spec/lib/escort/ --seed 34021
Run options: include {:focus=>true}

All examples were filtered out; ignoring {:focus=>true}

Randomized with seed 34021

...

Escort::Setup::Configuration::Locator::Chaining
  #locate
    when descending and current script locators are specified
      and file should be found by current script locator
        should == "/.blahrc"
      and file should not be found
        should be nil
      and file should be found by descending locator
        should == "/Users/idmoussiyoussef/.blahrc"
    when executing directory locator specified
      and file should not be found by it
        should be nil
      and file should be found by it
        should == "/.blahrc" (FAILED - 1)
    when no sub-locators specified
      should be nil
  #add_locator
    should == 1
    should == #<Escort::Setup::Configuration::Locator::Chaining:0x00007fc6f796b480 @filename=".blahrc", @locators=["blah"]>

Failures:

  1) Escort::Setup::Configuration::Locator::Chaining#locate when executing directory locator specified and file should be found by it should == "/.blahrc"
     Failure/Error: it {subject.should == path}

     TypeError:
       superclass mismatch for class File
     # ./spec/lib/escort/setup/configuration/locator/chaining_spec.rb:45:in `block (5 levels) in <top (required)>'

...


Finished in 0.4203 seconds (files took 0.22204 seconds to load)
244 examples, 1 failure

Failed examples:

rspec ./spec/lib/escort/setup/configuration/locator/chaining_spec.rb:45 # Escort::Setup::Configuration::Locator::Chaining#locate when executing directory locator specified and file should be found by it should == "/.blahrc"

Randomized with seed 34021

Any ideas where to start to fix this ?