Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Ignore key order in javascript spec

Hash key order is random on ruby 1.8.7
  • Loading branch information...
commit 70bde96640526943b2ea7f719c4afc03a6d0da99 1 parent cd68240
@bowsersenior bowsersenior authored
Showing with 7 additions and 1 deletion.
  1. +7 −1 spec/yacht/javascript_spec.rb
View
8 spec/yacht/javascript_spec.rb
@@ -26,7 +26,13 @@
subject.stub(:to_hash).and_return(:foo => 'bar', :baz => 'snafu')
subject.stub(:js_keys).and_return(:baz)
- subject.to_js_snippet(:merge => {:request_id => 123}).should == ';var Yacht = {"baz":"snafu","request_id":123};'
+ correct_snippets = [ # hash key order is random in ruby 1.8.7
+ ';var Yacht = {"baz":"snafu","request_id":123};',
+ ';var Yacht = {"request_id":123,"baz":"snafu"};'
+ ]
+
+ actual = subject.to_js_snippet(:merge => {:request_id => 123})
+ correct_snippets.should include(actual)
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.