From f66862c508d5405006639c3dd63b4322b9483e30 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Thu, 25 Dec 2014 14:35:45 -0500 Subject: [PATCH] Install rake if the lib isn't there; upgrade to cucumber 1.3.18 --- Gemfile | 4 ++-- features/markdown.feature | 2 +- features/site_configuration.feature | 2 +- features/step_definitions/jekyll_steps.rb | 1 + script/bootstrap | 2 +- script/cucumber | 3 +++ script/test | 10 +++++++++- 7 files changed, 18 insertions(+), 6 deletions(-) diff --git a/Gemfile b/Gemfile index c79afe7c..2bc6abc3 100644 --- a/Gemfile +++ b/Gemfile @@ -6,7 +6,7 @@ gem 'rdoc', '~> 3.11' gem 'redgreen', '~> 1.2' gem 'shoulda', '~> 3.5' gem 'rr', '~> 1.1' -gem 'cucumber', '1.3.11' +gem 'cucumber', '1.3.18' gem 'RedCloth', '~> 4.2' gem 'maruku', '~> 0.7.0' gem 'rdiscount', '~> 1.6' @@ -20,7 +20,7 @@ gem 'jekyll_test_plugin_malicious' gem 'rouge', '~> 1.7' gem 'liquid-c', '~> 0.0.3' gem 'minitest' if RUBY_PLATFORM =~ /cygwin/ -gem 'test-unit' if RUBY_PLATFORM =~ /cygwin/ +gem 'test-unit' if RUBY_PLATFORM =~ /cygwin/ || RUBY_VERSION.start_with?("2.2") if ENV['BENCHMARK'] gem 'rbtrace' diff --git a/features/markdown.feature b/features/markdown.feature index 659eed0f..895c927a 100644 --- a/features/markdown.feature +++ b/features/markdown.feature @@ -47,7 +47,7 @@ Feature: Markdown And I should see "My awesome code" in "_site/index.html" And I should see "
My awesome code
" in "_site/index.html" - Scenario: Maruku fenced codeblocks + Scenario: Maruku fenced codeblocks with syntax highlighting Given I have a configuration file with "markdown" set to "maruku" And I have an "index.markdown" file with content: """ diff --git a/features/site_configuration.feature b/features/site_configuration.feature index 1d067f0c..13dd7aa1 100644 --- a/features/site_configuration.feature +++ b/features/site_configuration.feature @@ -180,7 +180,7 @@ Feature: Site configuration And I have an "index.html" page with layout "page" that contains "site index page" And I have a configuration file with: | key | value | - | timezone | Australia/Melbourne | + | timezone | Australia/Sydney | And I have a _posts directory And I have the following posts: | title | date | layout | content | diff --git a/features/step_definitions/jekyll_steps.rb b/features/step_definitions/jekyll_steps.rb index 069f93b0..3b77d03b 100644 --- a/features/step_definitions/jekyll_steps.rb +++ b/features/step_definitions/jekyll_steps.rb @@ -24,6 +24,7 @@ end After do FileUtils.rm_rf(TEST_DIR) if File.exist?(TEST_DIR) FileUtils.rm(JEKYLL_COMMAND_OUTPUT_FILE) if File.exist?(JEKYLL_COMMAND_OUTPUT_FILE) + Dir.chdir(File.dirname(TEST_DIR)) end World(Test::Unit::Assertions) diff --git a/script/bootstrap b/script/bootstrap index 097f3e27..99756046 100755 --- a/script/bootstrap +++ b/script/bootstrap @@ -1,4 +1,4 @@ #!/bin/sh script/branding -bundle install +bundle install -j8 diff --git a/script/cucumber b/script/cucumber index c6957356..aeb9032d 100755 --- a/script/cucumber +++ b/script/cucumber @@ -1,5 +1,8 @@ #!/bin/bash +ls /usr/share/zoneinfo +ls /usr/share/zoneinfo/Australia + time bundle exec cucumber \ -f Features::Support::Overview \ "$@" diff --git a/script/test b/script/test index 7bb742ef..52dc4b92 100755 --- a/script/test +++ b/script/test @@ -10,7 +10,15 @@ else TEST_FILES="$@" fi -RAKE_LIB_DIR=$(ruby -e "puts Gem::Specification.find_by_name('rake').gem_dir + '/lib'") +# bundle exec gem env +GEM_DIR=$(bundle exec gem env | grep -C 1 "GEM PATHS" | tail -1 | cut -d '-' -f2 | cut -d' ' -f2) +RAKE_LIB_WITH_VERSION=$(bundle exec ruby -e "puts Gem::Specification.find_by_name('rake').gem_dir.split('/').last + '/lib'") +RAKE_LIB_DIR="${GEM_DIR}/gems/${RAKE_LIB_WITH_VERSION}" + +test -d "${RAKE_LIB_DIR}" || { + echo "No ${RAKE_LIB_DIR}. Installing Rake." + bundle show rake | cut -d'/' -f12 | cut -d'-' -f 2 | xargs bundle exec gem install rake -v +} set -x