Last active
April 24, 2017 20:16
-
-
Save jerilevine/478fdeb43754d4e9b7ce6b4f74fa2e06 to your computer and use it in GitHub Desktop.
Revisions
-
jerilevine revised this gist
Apr 24, 2017 . No changes.There are no files selected for viewing
-
jerilevine created this gist
Feb 15, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ LOG_DIR = Rails.root.join('log') LOG = Logger.new(File.join(LOG_DIR, "turnip_#{Time.now.strftime("%Y%m%d%H%M")}.log")) LOG.level = Logger::DEBUG RSpec.configure do |config| config.before(:each) do | scenario | LOG.info("========================================") LOG.info("Starting test #{scenario.example_group.description}") end config.after(:each) do | scenario | LOG.info("Test #{scenario.example_group.description} completed.") end end This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ # Monkeypatch for https://github.com/jnicklas/turnip # Output Turnip stepwise results to log file module Turnip module RSpec module Execute alias_method :old_run_step, :run_step def run_step(feature_file, step) begin old_run_step(feature_file, step) LOG.info("#{step.description}: As expected. PASS") rescue Turnip::Pending, ::RSpec::Core::Pending::SkipDeclaredInExample => e LOG.warn("#{step.description}: No such step. PENDING") raise rescue StandardError, ::RSpec::Expectations::ExpectationNotMetError => e LOG.error("#{step.description}: FAILED") raise e end end end end end