Skip to content

Commit

Permalink
updated rest of test cases
Browse files Browse the repository at this point in the history
git-svn-id: http://bundle-fu.googlecode.com/svn/trunk@107 1db77ec0-6337-0410-9320-454da9aca44f
  • Loading branch information
timcharper committed Nov 18, 2007
1 parent 93ab292 commit 015dd3a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
8 changes: 6 additions & 2 deletions test/functional/css_bundle_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
require File.join(File.dirname(__FILE__), '../test_helper.rb')

class CSSBundleTest < Test::Unit::TestCase
def setup
@bundle_fu = BundleFu.new({})
end

def test__rewrite_relative_path__should_rewrite
assert_rewrites("/stylesheets/active_scaffold/default/stylesheet.css",
"../../../images/spinner.gif" => "/images/spinner.gif",
Expand Down Expand Up @@ -36,13 +40,13 @@ def test__rewrite_relative_path__shouldnt_rewrite_if_absolute_url
end

def test__bundle_css_file__should_rewrite_relatiave_path
bundled_css = BundleFu.bundle_css_files(["/stylesheets/css_3.css"])
bundled_css = @bundle_fu.bundle_css_files(["/stylesheets/css_3.css"])
assert_match("background-image: url(/images/background.gif)", bundled_css)
assert_match("background-image: url(/images/groovy/background_2.gif)", bundled_css)
end

def test__bundle_css_files__no_images__should_return_content
bundled_css = BundleFu.bundle_css_files(["/stylesheets/css_1.css"])
bundled_css = @bundle_fu.bundle_css_files(["/stylesheets/css_1.css"])
assert_match("css_1 { }", bundled_css)
end

Expand Down
10 changes: 6 additions & 4 deletions test/functional/js_bundle_test.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
require File.join(File.dirname(__FILE__), '../test_helper.rb')

class JSBundleTest < Test::Unit::TestCase
def setup
@bundle_fu = BundleFu.new({})
end

def test__bundle_js_files__bypass_bundle__should_bypass
BundleFu.bundle_js_files
@bundle_fu.bundle_js_files([])
end

def test__bundle_js_files__should_include_contents
bundled_js = BundleFu.bundle_js_files(["/javascripts/js_1.js"])
# puts bundled_js
# function js_1
bundled_js = @bundle_fu.bundle_js_files(["/javascripts/js_1.js"])
assert_match("function js_1", bundled_js)
end
end

0 comments on commit 015dd3a

Please sign in to comment.