Fix for jruby

This commit is contained in:
Parker Moore 2016-06-28 18:30:02 -07:00
parent 2ef70fd348
commit 6f3c01ca87
No known key found for this signature in database
GPG Key ID: 193CDEBA72063C58
3 changed files with 4 additions and 3 deletions

View File

@ -23,6 +23,8 @@ group :test do
gem "nokogiri"
gem "rspec"
gem "test-theme", path: File.expand_path("./test/fixtures/test-theme", File.dirname(__FILE__))
gem "jruby-openssl" if RUBY_ENGINE == "jruby"
end
#

View File

@ -1,6 +1,7 @@
require "webrick"
require "mercenary"
require "helper"
require "openssl"
class TestCommandsServe < JekyllUnitTest
def custom_opts(what)
@ -114,8 +115,6 @@ class TestCommandsServe < JekyllUnitTest
end
should "allow SSL with a key and cert" do
skip "JRuby does not have OpenSSL bindings." if jruby?
expect(OpenSSL::PKey::RSA).to receive(:new).and_return("c2")
expect(OpenSSL::X509::Certificate).to receive(:new).and_return("c1")
allow(File).to receive(:read).and_return("foo")

View File

@ -320,7 +320,7 @@ class TestUtils < JekyllUnitTest
context "The \`Utils.safe_glob\` method" do
should "not apply pattern to the dir" do
dir = "test/safe_glob_test["
assert_equal [], Dir.glob(dir + "/*")
assert_equal [], Dir.glob(dir + "/*") unless jruby?
assert_equal ["test/safe_glob_test[/find_me.txt"], Utils.safe_glob(dir, "*")
end