From 6f3c01ca8772434f8e205bd7c06c0750233cec92 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Tue, 28 Jun 2016 18:30:02 -0700 Subject: [PATCH] Fix for jruby --- Gemfile | 2 ++ test/test_commands_serve.rb | 3 +-- test/test_utils.rb | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 253826aa..3dc758ef 100644 --- a/Gemfile +++ b/Gemfile @@ -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 # diff --git a/test/test_commands_serve.rb b/test/test_commands_serve.rb index 244ca444..f129a07e 100644 --- a/test/test_commands_serve.rb +++ b/test/test_commands_serve.rb @@ -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") diff --git a/test/test_utils.rb b/test/test_utils.rb index e2a50c58..5fbb99fc 100644 --- a/test/test_utils.rb +++ b/test/test_utils.rb @@ -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