Skip to content

Commit

Permalink
'test_describe_first_structure' fixed with array sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
fl00r committed Mar 3, 2012
1 parent 93ef3da commit 8951971
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions lib/minitest/spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,7 @@ def self.it desc = "anonymous", &block
regexp = if RUBY_VERSION.to_f >= 1.9
Regexp.new("[^[[:word:]]]+")
else
$KCODE = 'U'
Regexp.new(/\W+/)
Regexp.new(/\W+/u)
end
name = "test_%04d_%s" % [ @specs, desc.gsub(regexp, '_').downcase ]

Expand Down
4 changes: 2 additions & 2 deletions test/test_minitest_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -689,8 +689,8 @@ def test_describe_first_structure
z = describe "second thingy" do end
end

assert_equal ['test_0001_top_level_it', 'test_0002_не_латинские_буквы_и_спецсимволы_いった_α_β_γ_δ_ε_hello_world'],
x.instance_methods.grep(/^test/).map {|o| o.to_s}
assert_equal ['test_0001_top_level_it', 'test_0002_не_латинские_буквы_и_спецсимволы_いった_α_β_γ_δ_ε_hello_world'].sort,
x.instance_methods.grep(/^test/).map {|o| o.to_s}.sort
assert_equal [], y.instance_methods.grep(/^test/)
assert_equal [], z.instance_methods.grep(/^test/)
end
Expand Down

0 comments on commit 8951971

Please sign in to comment.