From 6597bacee82808a108725c3eed2ccfb1a6bb9163 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Mon, 20 Apr 2015 10:53:53 -0700 Subject: [PATCH] features: Update the way we access Minitest assertions Per https://github.com/cucumber/cucumber/wiki/Using-MiniTest. --- features/step_definitions/jekyll_steps.rb | 4 +++- features/support/env.rb | 11 ++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/features/step_definitions/jekyll_steps.rb b/features/step_definitions/jekyll_steps.rb index 5e0509e1..27c8692d 100644 --- a/features/step_definitions/jekyll_steps.rb +++ b/features/step_definitions/jekyll_steps.rb @@ -27,7 +27,9 @@ After do Dir.chdir(File.dirname(TEST_DIR)) end -World(Minitest::Assertions) +World do + MinitestWorld.new +end Given /^I have a blank site in "(.*)"$/ do |path| FileUtils.mkdir_p(path) unless File.exist?(path) diff --git a/features/support/env.rb b/features/support/env.rb index 43d74ab9..9e9f47fd 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -1,8 +1,17 @@ require 'fileutils' require 'posix-spawn' -require 'minitest/assertions' +require 'minitest/spec' require 'time' +class MinitestWorld + extend Minitest::Assertions + attr_accessor :assertions + + def initialize + self.assertions = 0 + end +end + JEKYLL_SOURCE_DIR = File.dirname(File.dirname(File.dirname(__FILE__))) TEST_DIR = File.expand_path(File.join('..', '..', 'tmp', 'jekyll'), File.dirname(__FILE__)) JEKYLL_PATH = File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'bin', 'jekyll'))