spec/spec_helper.rb in jekyll-gist-1.3.5 vs spec/spec_helper.rb in jekyll-gist-1.4.0
- old
+ new
@@ -5,11 +5,10 @@
require 'cgi'
require 'jekyll'
require File.expand_path("../lib/jekyll-gist.rb", TEST_DIR)
Jekyll.logger.log_level = :error
-STDERR.reopen(test(?e, '/dev/null') ? '/dev/null' : 'NUL:')
RSpec.configure do |config|
config.run_all_when_everything_filtered = true
config.filter_run :focus
config.order = 'random'
@@ -25,11 +24,11 @@
def dest_dir(*files)
tmp_dir('dest', *files)
end
def doc_with_content(content, opts = {})
- my_site = site
+ my_site = site(opts)
Jekyll::Document.new(source_dir('_test/doc.md'), {site: my_site, collection: collection(my_site)})
end
def collection(site, label = 'test')
Jekyll::Collection.new(site, label)
@@ -39,7 +38,12 @@
conf = Jekyll::Utils.deep_merge_hashes(Jekyll::Configuration::DEFAULTS, opts.merge({
"source" => source_dir,
"destination" => dest_dir
}))
Jekyll::Site.new(conf)
+ end
+
+ def fixture(name)
+ path = File.expand_path "./fixtures/#{name}.json", File.dirname(__FILE__)
+ File.open(path).read
end
end