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

Specs fail on MRI Ruby 2.1.0 #1064

Closed
felixbuenemann opened this issue Jan 5, 2014 · 7 comments
Closed

Specs fail on MRI Ruby 2.1.0 #1064

felixbuenemann opened this issue Jan 5, 2014 · 7 comments
Labels
infrastructure Non-spec task or chore

Comments

@felixbuenemann
Copy link

[ 188/1376] ExtendTest#test_multiple_extends_with_multiple_extenders_and_single_target = 0.01 s
  4) Failure:
ExtendTest#test_multiple_extends_with_multiple_extenders_and_single_target [/Users/felix/dev/gems/sass/test/sass/extend_test.rb:111]:
<".foo.bar, .bar.baz, .baz.bang, .foo.bang {\n  a: b; }\n"> expected but was
<".foo.bar, .bar.baz, .bang.baz, .foo.bang {\n  a: b; }\n">.

[ 229/1376] ExtendTest#test_parent_and_sibling_extend = 0.01 s
  5) Failure:
ExtendTest#test_parent_and_sibling_extend [/Users/felix/dev/gems/sass/test/sass/extend_test.rb:1250]:
<".parent1 .parent2 .child1.child2, .parent2 .parent1 .child1.child2 {\n  c: d; }\n"> expected but was
<".parent1 .parent2 .child2.child1, .parent2 .parent1 .child2.child1 {\n  c: d; }\n">.

For some reason the order of the class names is not alphabetical.

@felixbuenemann
Copy link
Author

It seems the order of items returned by uniq has changed in ruby 2.1.0 (see https://bugs.ruby-lang.org/issues/9340) and Sass::Selector::SimpleSequence#do_extend returns uniq without sort. Unfortunately using sort here breaks a lot of other tests, but replacing uniq with uniq {|p| p} fixes the specs, so this seems to be the exact issue.

@chriseppstein
Copy link

I added ruby 2.1 to the build matrix on master: bf4c1a0

@chriseppstein
Copy link

it seems like ruby fixed this for the next release, given that the output is semantically identical, it would be nice to simply fix the test assertions to stop caring about this difference.

@felixbuenemann
Copy link
Author

I'll give it a try.

@chriseppstein
Copy link

@felixbuenemann Thanks!

@nex3
Copy link
Contributor

nex3 commented Jan 7, 2014

I'm actually content not to make the tests resilient to this, especially if the old behavior is going to be preserved in a future release of 2.1.0. I'd like the Sass output to remain consistent between Ruby versions as much as possible, and I'm happy to have our tests catch cases where it isn't. In this case, for example, under the 2.0.0 behavior the selector's source order is preserved, which is nice.

@felixbuenemann
Copy link
Author

OK, I'll close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infrastructure Non-spec task or chore
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants