Fix for jruby
This commit is contained in:
parent
2ef70fd348
commit
6f3c01ca87
2
Gemfile
2
Gemfile
|
|
@ -23,6 +23,8 @@ group :test do
|
||||||
gem "nokogiri"
|
gem "nokogiri"
|
||||||
gem "rspec"
|
gem "rspec"
|
||||||
gem "test-theme", path: File.expand_path("./test/fixtures/test-theme", File.dirname(__FILE__))
|
gem "test-theme", path: File.expand_path("./test/fixtures/test-theme", File.dirname(__FILE__))
|
||||||
|
|
||||||
|
gem "jruby-openssl" if RUBY_ENGINE == "jruby"
|
||||||
end
|
end
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
require "webrick"
|
require "webrick"
|
||||||
require "mercenary"
|
require "mercenary"
|
||||||
require "helper"
|
require "helper"
|
||||||
|
require "openssl"
|
||||||
|
|
||||||
class TestCommandsServe < JekyllUnitTest
|
class TestCommandsServe < JekyllUnitTest
|
||||||
def custom_opts(what)
|
def custom_opts(what)
|
||||||
|
|
@ -114,8 +115,6 @@ class TestCommandsServe < JekyllUnitTest
|
||||||
end
|
end
|
||||||
|
|
||||||
should "allow SSL with a key and cert" do
|
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::PKey::RSA).to receive(:new).and_return("c2")
|
||||||
expect(OpenSSL::X509::Certificate).to receive(:new).and_return("c1")
|
expect(OpenSSL::X509::Certificate).to receive(:new).and_return("c1")
|
||||||
allow(File).to receive(:read).and_return("foo")
|
allow(File).to receive(:read).and_return("foo")
|
||||||
|
|
|
||||||
|
|
@ -320,7 +320,7 @@ class TestUtils < JekyllUnitTest
|
||||||
context "The \`Utils.safe_glob\` method" do
|
context "The \`Utils.safe_glob\` method" do
|
||||||
should "not apply pattern to the dir" do
|
should "not apply pattern to the dir" do
|
||||||
dir = "test/safe_glob_test["
|
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, "*")
|
assert_equal ["test/safe_glob_test[/find_me.txt"], Utils.safe_glob(dir, "*")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue