Open pravi opened 5 years ago
A crude method is like this, let me try to make it more generic.
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -80,7 +80,7 @@
@source = nil
@patch_path = nil
@path = nil
- @assets_path = nil
+ @assets_path = Pathname.new('/usr/share/rubygems-integration/all/gems/handlebars_assets-0.23.2/vendor/assets/javascripts')
end
end
This change makes all tests except one to pass
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -80,7 +80,7 @@
@source = nil
@patch_path = nil
@path = nil
- @assets_path = nil
+ @assets_path = Pathname.new(HandlebarsAssets::PATH)
end
end
1) Failure:
HandlebarsAssets::CompilingTest#test_custom_handlebars [/<<PKGBUILDDIR>>/test/handlebars_assets/compiling_test.rb:17]:
Expected /PRECOMPILE CALLED/ to match "{\"compiler\":[7,\">= 4.0.0\"],\"main\":function(container,depth0,helpers,partials,data) {\n var helper;\n\n return \"This is \"\n + container.escapeExpression(((helper = (helper = helpers.handlebars || (depth0 != null ? depth0.handlebars : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === \"function\" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{\"name\":\"handlebars\",\"hash\":{},\"data\":data}) : helper)));\n},\"useData\":true}".
28 runs, 50 assertions, 1 failures, 0 errors, 0 skips
Actually this patch also failed the same way in autopkgtest (the earlier test run was during build). For now I have disabled autopkgtest, but it'd be nice to be able to run it.
When using the globally installed handlebars,
all tests fails to find the assets.
https://ci.debian.net/data/packages/unstable/amd64/r/ruby-handlebars-assets/latest-autopkgtest/log.gz This works when assets are present locally, but we'd like to test the installed package also in debian. If there is a way to make this look for assets relative the the installed path instead of relative to test file path, that would help.