Permalink
Browse files

Updated tests to account for media_root attribute

  • Loading branch information...
1 parent 24b2da0 commit 9e7e3fac83a5cb402b58d5ff6236dc4d1175449b @crsven committed Aug 16, 2011
Showing with 16 additions and 0 deletions.
  1. +14 −0 test/cli_test.rb
  2. +1 −0 test/deadweight_test.rb
  3. +1 −0 test/test_helper.rb
View
@@ -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
@@ -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
@@ -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

0 comments on commit 9e7e3fa

Please sign in to comment.