test/test_jim_bundler.rb in jim-0.1.2 vs test/test_jim_bundler.rb in jim-0.2.0

- old
+ new

@@ -24,35 +24,36 @@ assert @bundler assert_equal fixture('jimfile'), @bundler.jimfile end should "parse options out of jimfile" do - assert_equal 'tmp/public/javascripts/bundled.js', @bundler.options[:bundled_path] - assert_equal 'tmp/public/javascripts/vendor', @bundler.options[:vendor_dir] + assert_equal 'test/tmp/public/javascripts/bundled.js', @bundler.options[:bundled_path] + assert_equal 'test/tmp/public/javascripts/vendor', @bundler.options[:vendor_dir] end - should "set index" do + should "set index and include vendor dir" do assert @bundler.index.is_a?(Jim::Index) - assert_equal @directories, @bundler.index.directories + assert_equal [@bundler.options[:vendor_dir]] + @directories, @bundler.index.directories end end context "resolve!" do should "find projects listed in the jimfile and set paths" do assert @bundler.paths.empty? @bundler.resolve! assert @bundler.paths assert_equal 2, @bundler.paths.length - @bundler.paths.each do |path| + @bundler.paths.each do |path, name, version| assert path.is_a?(Pathname) + assert name.is_a?(String) end end should "set paths in same order as in jimfile" do @bundler.resolve! - assert_equal Pathname.new(fixture_path('jquery-1.4.1.js')), @bundler.paths.first + assert_equal Pathname.new(fixture_path('jquery-1.4.1.js')), @bundler.paths[0][0] end should "raise error if file can not be found" do FileUtils.rm_rf(tmp_path) if File.directory?(tmp_path) assert_raise(Jim::Bundler::MissingFile) { @@ -65,11 +66,11 @@ context "vendor!" do should "copy files in jemfile to path specified" do vendor_dir = Pathname.new(tmp_path) + 'vendor' @bundler.vendor!(vendor_dir) - assert_readable vendor_dir + 'jquery.js' - assert_readable vendor_dir + 'myproject.js' + assert_readable vendor_dir + 'jquery-1.4.1.js' + assert_readable vendor_dir + 'myproject-1.2.2.js' end end context "bundle!" do