test/runner_test.rb in sprite-factory-1.6.1 vs test/runner_test.rb in sprite-factory-1.6.2
- old
+ new
@@ -16,50 +16,66 @@
assert_equal(REGULAR_PATH + ".css", r.output_style_file)
assert_equal(REGULAR, r.image_files)
assert_equal(:horizontal, r.layout_name)
assert_equal(:css, r.style_name)
assert_equal(:rmagick, r.library_name)
+ assert_equal(DIRECTORY_SEPARATOR, r.directory_separator)
r = Runner.new(IRREGULAR_PATH)
assert_equal(IRREGULAR_PATH, r.input)
assert_equal(IRREGULAR_PATH, r.output)
assert_equal(IRREGULAR_PATH + ".png", r.output_image_file)
assert_equal(IRREGULAR_PATH + ".css", r.output_style_file)
assert_equal(IRREGULAR, r.image_files)
assert_equal(:horizontal, r.layout_name)
assert_equal(:css, r.style_name)
assert_equal(:rmagick, r.library_name)
+ assert_equal(DIRECTORY_SEPARATOR, r.directory_separator)
+ r = Runner.new(IRREGULAR_PATH, :directory_separator => '.')
+ assert_equal(IRREGULAR_PATH, r.input)
+ assert_equal(IRREGULAR_PATH, r.output)
+ assert_equal(IRREGULAR_PATH + ".png", r.output_image_file)
+ assert_equal(IRREGULAR_PATH + ".css", r.output_style_file)
+ assert_equal(IRREGULAR, r.image_files)
+ assert_equal(:horizontal, r.layout_name)
+ assert_equal(:css, r.style_name)
+ assert_equal(:rmagick, r.library_name)
+ assert_equal('.', r.directory_separator)
+
r = Runner.new(REGULAR_PATH, :output => IRREGULAR_PATH)
assert_equal(REGULAR_PATH, r.input)
assert_equal(IRREGULAR_PATH, r.output)
assert_equal(IRREGULAR_PATH + ".png", r.output_image_file)
assert_equal(IRREGULAR_PATH + ".css", r.output_style_file)
assert_equal(REGULAR, r.image_files)
assert_equal(:horizontal, r.layout_name)
assert_equal(:css, r.style_name)
assert_equal(:rmagick, r.library_name)
+ assert_equal(DIRECTORY_SEPARATOR, r.directory_separator)
r = Runner.new(REGULAR_PATH, :output_image => "foo.png", :output_style => "bar.css.sass.erb")
assert_equal(REGULAR_PATH, r.input)
assert_equal(REGULAR_PATH, r.output)
assert_equal("foo.png", r.output_image_file)
assert_equal("bar.css.sass.erb", r.output_style_file)
assert_equal(REGULAR, r.image_files)
assert_equal(:horizontal, r.layout_name)
assert_equal(:css, r.style_name)
assert_equal(:rmagick, r.library_name)
+ assert_equal(DIRECTORY_SEPARATOR, r.directory_separator)
r = Runner.new(REGULAR_PATH, :layout => :vertical, :library => :chunkypng, :style => :sass)
assert_equal(REGULAR_PATH, r.input)
assert_equal(REGULAR_PATH, r.output)
assert_equal(REGULAR_PATH + ".png", r.output_image_file)
assert_equal(REGULAR_PATH + ".sass", r.output_style_file)
assert_equal(REGULAR, r.image_files)
assert_equal(:vertical, r.layout_name)
assert_equal(:sass, r.style_name)
assert_equal(:chunkypng, r.library_name)
+ assert_equal(DIRECTORY_SEPARATOR, r.directory_separator)
end
end
@@ -217,9 +233,17 @@
"div.foo img.icon:focus",
"div.foo img.icon:hover",
"div.foo img.icon:active",
]
actual = Runner.new(HOVER_PATH).load_images.map{|i| i[:name]}
+ assert_equal(expected, actual)
+ end
+ end
+
+ def test_use_specified_directory_separator
+ Runner.publicize_methods do
+ expected = %w(england.amy england.bob france.bob usa.amy usa.bob)
+ actual = Runner.new(SUBFOLDERS_PATH, :directory_separator => '.').load_images.map{|i| i[:name]}
assert_equal(expected, actual)
end
end
#----------------------------------------------------------------------------