File: spec_helper.rb

package info (click to toggle)
ruby-jekyll-commonmark 1.4.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 200 kB
  • sloc: ruby: 271; sh: 9; makefile: 7
file content (23 lines) | stat: -rw-r--r-- 521 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# frozen_string_literal: true

require "jekyll"
require "jekyll-commonmark"

Jekyll.logger.log_level = :info

RSpec.configure do |config|
  config.run_all_when_everything_filtered = true
  config.filter_run :focus
  config.order = "random"

  def capture_stdout(level = :debug)
    buffer = StringIO.new
    Jekyll.logger = Logger.new(buffer)
    Jekyll.logger.log_level = level
    result = yield
    buffer.rewind
    [result, buffer.string.to_s]
  ensure
    Jekyll.logger = Logger.new(StringIO.new, :error)
  end
end