Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RSpec isolated environment not isolated enough? #418

Closed
L2G opened this issue Aug 6, 2013 · 5 comments · Fixed by #652
Closed

RSpec isolated environment not isolated enough? #418

L2G opened this issue Aug 6, 2013 · 5 comments · Fixed by #652
Assignees
Labels

Comments

@L2G
Copy link

L2G commented Aug 6, 2013

I am noticing some spec failures happen because my home directory's .rubocop.yml file is apparently overriding settings that are assumed by the specs.

For example, if my .rubocop.yml file specifies a line length of 90, then specs that expect lines longer than 79 or 80 characters to raise an offense will fail.

This is on a Windows 7 system running Ruby 1.9.3p392, so perhaps it's platform-specific. (I'm working on some other spec failures I've found with Windows, but this one has me stumped.)

@L2G
Copy link
Author

L2G commented Aug 6, 2013

Here's a sample failure where my ~/.rubocop.yml file is overriding expectations in the specs:

Failures:

  1) Rubocop::CLI can report in clang style
     Failure/Error: expect($stdout.string)

       expected: "example1.rb:2:2: C: Surrounding space missing for operator '='.\nx= 0 \n ^\nexample1.rb:2:5: C: Trailing whitespace detected.\nx= 0 \n    ^\nexample1.rb:3:80: C: Line is too long. [85/79]\n#####################################################################################\n                                                                               ^^^^^^\nexample1.rb:4:2: C: Trailing whitespace detected.\ny \n ^\nexample2.rb:2:1: C: Tab detected.\n\tx = 0\n^\n\n2 files inspected, 5 offences detected\n"
            got: "example1.rb:2:2: C: Surrounding space missing for operator '='.\nx= 0 \n ^\nexample1.rb:2:5: C: Trailing whitespace detected.\nx= 0 \n    ^\nexample1.rb:4:2: C: Trailing whitespace detected.\ny \n ^\nexample2.rb:2:1: C: Tab detected.\n\tx = 0\n^\n\n2 files inspected, 4 offences detected\n"

       (compared using ==)

       Diff:
       @@ -4,9 +4,6 @@
        example1.rb:2:5: C: Trailing whitespace detected.
        x= 0 
            ^
       -example1.rb:3:80: C: Line is too long. [85/79]
       -#####################################################################################
       -                                                                               ^^^^^^
        example1.rb:4:2: C: Trailing whitespace detected.
        y 
         ^
       @@ -14,5 +11,5 @@
            x = 0
        ^

       -2 files inspected, 5 offences detected
       +2 files inspected, 4 offences detected
     # ./spec/rubocop/cli_spec.rb:250:in `block (2 levels) in <module:Rubocop>'
     # ./spec/support/isolated_environment.rb:20:in `block (4 levels) in <top (required)>'
     # ./spec/support/isolated_environment.rb:19:in `chdir'
     # ./spec/support/isolated_environment.rb:19:in `block (3 levels) in <top (required)>'
     # ./spec/support/isolated_environment.rb:8:in `block (2 levels) in <top (required)>'

@jonas054
Copy link
Collaborator

jonas054 commented Aug 7, 2013

I don't get the exact same problems on Linux but I do find that the "isolated environment not isolated enough" when I put a .rubocop.yml in ~ or /tmp. There are failing specs for Rubocop::CLI and Rubocop::Config.configuration_file_for when I run.

@bbatsov
Copy link
Collaborator

bbatsov commented Aug 9, 2013

Yep, I noticed the same problem today.

@bbatsov
Copy link
Collaborator

bbatsov commented Nov 26, 2013

@jonas054 Any progress here?

@ghost ghost assigned jonas054 Nov 26, 2013
@jonas054
Copy link
Collaborator

Not yet, but I'll start looking shortly.

jonas054 added a commit to jonas054/rubocop that referenced this issue Nov 28, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants