Permalink
Browse files

test/test_scene fails because the filenames list is not sorted - Fix it.

  • Loading branch information...
1 parent 17c7e75 commit f5367da14aacfcdff4b29c911b7106f85cd3a130 @gwolf gwolf committed Aug 12, 2011
Showing with 2 additions and 2 deletions.
  1. +1 −1 lib/gruff/scene.rb
  2. +1 −1 test/test_scene.rb
View
2 lib/gruff/scene.rb
@@ -133,7 +133,7 @@ class Gruff::Layer
def initialize(base_dir, folder_name)
@base_dir = base_dir.to_s
@name = folder_name.to_s
- @filenames = Dir.open(File.join(base_dir, folder_name)).entries.select { |file| file =~ /^[^.]+\.png$/ }
+ @filenames = Dir.open(File.join(base_dir, folder_name)).entries.select { |file| file =~ /^[^.]+\.png$/ }.sort
@selected_filename = select_default
end
View
2 test/test_scene.rb
@@ -51,7 +51,7 @@ def test_stormy_day
def test_layer
l = LayerStub.new(File.expand_path("../assets/city_scene", File.dirname(__FILE__)), "clouds")
- assert_equal %w(cloudy.png partly_cloudy.png stormy.png), l.filenames
+ assert_equal %w(cloudy.png partly_cloudy.png stormy.png), l.filenames.sort
l = LayerStub.new(File.expand_path("../assets/city_scene", File.dirname(__FILE__)), "grass")
assert_equal 'default.png', l.selected_filename

0 comments on commit f5367da

Please sign in to comment.