Merge pull request #5015 from jekyll/remove-jruby-and-ruby-head
Merge pull request 5015
This commit is contained in:
commit
325b4c88d5
|
@ -1,4 +1,3 @@
|
||||||
before_script: bundle update
|
|
||||||
bundler_args: --without benchmark:site:development
|
bundler_args: --without benchmark:site:development
|
||||||
script: script/cibuild
|
script: script/cibuild
|
||||||
cache: bundler
|
cache: bundler
|
||||||
|
@ -9,17 +8,13 @@ rvm:
|
||||||
- &ruby1 2.3.0
|
- &ruby1 2.3.0
|
||||||
- &ruby2 2.2.4
|
- &ruby2 2.2.4
|
||||||
- &ruby3 2.1.8
|
- &ruby3 2.1.8
|
||||||
- &jruby jruby-9.0.5.0
|
|
||||||
- &rhead ruby-head
|
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
fast_finish: true
|
|
||||||
allow_failures:
|
|
||||||
- rvm: *jruby
|
|
||||||
- rvm: *rhead
|
|
||||||
include:
|
include:
|
||||||
- rvm: 2.3.0
|
- rvm: 2.3.0
|
||||||
env: TEST_SUITE=fmt
|
env: TEST_SUITE=fmt
|
||||||
|
- rvm: jruby-9.0.5.0
|
||||||
|
env: TEST_SUITE=test
|
||||||
env:
|
env:
|
||||||
matrix:
|
matrix:
|
||||||
- TEST_SUITE=test
|
- TEST_SUITE=test
|
||||||
|
|
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
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# -----------------------------------------------------------------------------
|
||||||
|
# If you send us a ruby then we use that, if you do not then we test with
|
||||||
|
# whatever we can detect, this way you can run both suites when you test out
|
||||||
|
# your source, we expect full coverage now, not just MRI.
|
||||||
|
# -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
rubies=()
|
||||||
|
for r in jruby ruby; do
|
||||||
|
if which "$r" > /dev/null 2>&1
|
||||||
|
then
|
||||||
|
echo $r
|
||||||
|
fi
|
||||||
|
done
|
22
script/test
22
script/test
|
@ -31,26 +31,26 @@ then
|
||||||
|
|
||||||
shift
|
shift
|
||||||
else
|
else
|
||||||
rubies=()
|
rubies=($(script/rubies))
|
||||||
for r in jruby ruby; do
|
|
||||||
if which "$r"
|
|
||||||
then
|
|
||||||
rubies+=(
|
|
||||||
$r
|
|
||||||
)
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
for ruby in $rubies; do
|
for ruby in $rubies; do
|
||||||
|
if [[ "$ruby" == "jruby" ]]
|
||||||
|
then
|
||||||
|
testopts=""
|
||||||
|
else
|
||||||
|
testopts="--profile"
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ $# -lt 1 ]]
|
if [[ $# -lt 1 ]]
|
||||||
then
|
then
|
||||||
set -x
|
set -x
|
||||||
time $ruby -S bundle exec \
|
time $ruby -S bundle exec \
|
||||||
rake TESTOPTS='--profile' test
|
rake TESTOPTS=$testopts test
|
||||||
else
|
else
|
||||||
set -x
|
set -x
|
||||||
time $ruby -S bundle exec ruby -Itest \
|
time $ruby -S bundle exec ruby -Itest \
|
||||||
"$@" --profile
|
"$@" $testops
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
require "helper"
|
require "helper"
|
||||||
|
require "colorator"
|
||||||
|
|
||||||
class TestConfiguration < JekyllUnitTest
|
class TestConfiguration < JekyllUnitTest
|
||||||
test_config = {
|
test_config = {
|
||||||
|
@ -260,7 +261,9 @@ class TestConfiguration < JekyllUnitTest
|
||||||
allow(SafeYAML).to receive(:load_file).with(@path) do
|
allow(SafeYAML).to receive(:load_file).with(@path) do
|
||||||
raise SystemCallError, "No such file or directory - #{@path}"
|
raise SystemCallError, "No such file or directory - #{@path}"
|
||||||
end
|
end
|
||||||
allow($stderr).to receive(:puts).with("Configuration file: none".yellow)
|
allow($stderr).to receive(:puts).with(
|
||||||
|
Colorator.yellow("Configuration file: none")
|
||||||
|
)
|
||||||
assert_equal site_configuration, Jekyll.configuration(test_config)
|
assert_equal site_configuration, Jekyll.configuration(test_config)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -275,13 +278,12 @@ class TestConfiguration < JekyllUnitTest
|
||||||
allow($stderr)
|
allow($stderr)
|
||||||
.to receive(:puts)
|
.to receive(:puts)
|
||||||
.and_return(
|
.and_return(
|
||||||
("WARNING: "
|
"WARNING: ".rjust(20) +
|
||||||
.rjust(20) + "Error reading configuration. Using defaults (and options).")
|
Colorator.yellow("Error reading configuration. Using defaults (and options).")
|
||||||
.yellow
|
|
||||||
)
|
)
|
||||||
allow($stderr)
|
allow($stderr)
|
||||||
.to receive(:puts)
|
.to receive(:puts)
|
||||||
.and_return("Configuration file: (INVALID) #{@path}".yellow)
|
.and_return(Colorator.yellow("Configuration file: (INVALID) #{@path}"))
|
||||||
assert_equal site_configuration, Jekyll.configuration(test_config)
|
assert_equal site_configuration, Jekyll.configuration(test_config)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -291,10 +293,10 @@ class TestConfiguration < JekyllUnitTest
|
||||||
end
|
end
|
||||||
allow($stderr)
|
allow($stderr)
|
||||||
.to receive(:puts)
|
.to receive(:puts)
|
||||||
.with((
|
.with(Colorator.red(
|
||||||
"Fatal: ".rjust(20) + \
|
"Fatal: ".rjust(20) + \
|
||||||
"The configuration file '#{@user_config}' could not be found."
|
"The configuration file '#{@user_config}' could not be found."
|
||||||
).red)
|
))
|
||||||
assert_raises LoadError do
|
assert_raises LoadError do
|
||||||
Jekyll.configuration({ "config" => [@user_config] })
|
Jekyll.configuration({ "config" => [@user_config] })
|
||||||
end
|
end
|
||||||
|
|
|
@ -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