Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updated tests to account for media_root attribute

  • Loading branch information...
commit 9e7e3fac83a5cb402b58d5ff6236dc4d1175449b 1 parent 24b2da0
@crsven authored
View
14 test/cli_test.rb
@@ -17,5 +17,19 @@ class CliTest < Test::Unit::TestCase
assert_correct_selectors_in_output(`#{COMMAND} #{arg} test/fixtures -s /style.css /index.html 2>/dev/null`)
end
end
+
+ should "accept a [-m | --media_root] argument and relative paths" do
+ %w(-m --media_root).each do |arg|
+ assert_correct_selectors_in_output(`#{COMMAND} #{arg} test/fixtures -s /style.css test/fixtures/index.html 2>/dev/null`)
+ end
+ end
+
+ should "accept a [-m | --media_root] argument, along with a [-r | --root] argument and relative paths for each" do
+ %w(-m --media_root).each do |media_arg|
+ %w(-r --root).each do |root_arg|
+ assert_correct_selectors_in_output(`#{COMMAND} #{root_arg} test/fixtures #{media_arg} test/fixtures -s /style.css /index.html 2>/dev/null`)
+ end
+ end
+ end
end
View
1  test/deadweight_test.rb
@@ -19,6 +19,7 @@ def setup
should "have the same attributes" do
assert_equal(@dw.log_file, @dwb.log_file)
assert_equal(@dw.root, @dwb.root)
+ assert_equal(@dw.media_root, @dwb.media_root)
assert_equal(@dw.stylesheets, @dwb.stylesheets)
assert_equal(@dw.pages, @dwb.pages)
end
View
1  test/test_helper.rb
@@ -41,6 +41,7 @@ def assert_does_not_report_used_selectors(output)
def default_settings(dw)
dw.log_file = 'test.log'
dw.root = File.dirname(__FILE__) + '/fixtures'
+ dw.media_root = nil
dw.stylesheets << '/style.css'
dw.pages << '/index.html'
end
Please sign in to comment.
Something went wrong with that request. Please try again.