Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Running specs under subdirectory in Windows fails #396

Closed
jarmo opened this Issue · 1 comment

3 participants

@jarmo

When having specs in a subdirectory and running them with rspec spec\subdirectory in Windows will not find any examples.

Preconditions for this to happen:

C:\Users\jarmo\Desktop\minu\projects\Ruby\myproject>tree 
Folder PATH listing 
Volume serial number is E4DF-948C 
C:. 
-spec 
  -subdir 
C:\Users\jarmo\Desktop\minu\projects\Ruby\myproject>ls -laR 
total 0 
drwxrwxrwx   1 user     group           0 Jun  1 17:01 . 
drwxrwxrwx   1 user     group           0 Jun  1 06:15 .. 
drwxrwxrwx   1 user     group           0 Jun  1 17:47 spec 

spec=: 
total 0 
drwxrwxrwx   1 user     group           0 Jun  1 17:47 . 
drwxrwxrwx   1 user     group           0 Jun  1 17:01 .. 
drwxrwxrwx   1 user     group           0 Jun  1 17:46 subdir 

spec\subdir=: 
total 1 
drwxrwxrwx   1 user     group           0 Jun  1 17:46 . 
drwxrwxrwx   1 user     group           0 Jun  1 17:47 .. 
-rw-rw-rw-   1 user     group          49 Jun  1 17:46 my_spec.rb 

C:\Users\jarmo\Desktop\minu\projects\Ruby\myproject>cat spec\subdir 
\my_spec.rb 
describe "my" do 
  it "example" do 
  end 
end 

C:\Users\jarmo\Desktop\minu\projects\Ruby\myproject>rspec spec 
. 
Finished in 0.001 seconds 
1 example, 0 failures 

C:\Users\jarmo\Desktop\minu\projects\Ruby\myproject>rspec spec\subdir 
No examples found. 
Finished in 0 seconds 
0 examples, 0 failures

Here is the output for running specs:

C:\Users\jarmo\Desktop\minu\projects\Ruby\myproject>rspec spec\subdir 
No examples found. 
Finished in 0 seconds 
0 examples, 0 failures 

C:\Users\jarmo\Desktop\minu\projects\Ruby\myproject>rspec spec/subdir 
. 
Finished in 0.0045 seconds 
1 example, 0 failures 

As you can see then it is needed to use unix-like forwardslashes in the path. Everything works as expected with RSpec 1.3.1.

@hugoestr

I am seeing the same problem.

@jarmo jarmo referenced this issue
Merged

fixes #396 #605

@justinko justinko closed this issue from a commit
@jarmo jarmo fixes #396 2ea6f20
@justinko justinko closed this in 2ea6f20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.