Sha256: 03ff3e20df47faf10ebec62b92d1b01ba33ac32f995401ec62c78dad31cc9cee

Contents?: true

Size: 1.22 KB

Versions: 2

Compression:

Stored size: 1.22 KB

Contents

require "rubygems"

require "simplecov"
require "coveralls"

SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
  SimpleCov::Formatter::HTMLFormatter, Coveralls::SimpleCov::Formatter
]

SimpleCov.start

require_relative "../lib/jekyll/assets"

require "jekyll"
require "liquid"
require "sprockets"

# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Dir[File.expand_path("../support", __FILE__) + "/**/*.rb"]
  .each { |f| require f }

# rubocop:disable Metrics/AbcSize
def start_site
  if Gem::Version.new("2") <= Gem::Version.new(Jekyll::VERSION)
    Jekyll.logger.log_level = :warn
  else
    Jekyll.logger.log_level = Jekyll::Stevenson::WARN
  end

  @dest = fixtures_path.join("_site")
  @site = Jekyll::Site.new(Jekyll.configuration({
    "source"      => fixtures_path.to_s,
    "destination" => @dest.to_s
  }))

  @dest.rmtree if @dest.exist?
  @site.process
end
# rubocop:enable Metrics/AbcSize

RSpec.configure do |config|
  config.include FixturesHelpers
  config.extend  FixturesHelpers

  config.disable_monkey_patching!

  config.before(:all) do
    Jekyll::Assets::HOOKS.clear
    start_site
  end

  config.after(:all) do
    @dest.rmtree if @dest.exist?
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
jekyll-assets-1.0.0.pre.alpha1 spec/spec_helper.rb
jekyll-assets-1.0.0.pre.alpha0 spec/spec_helper.rb