adaoraul/rack-jekyll

Add option to process / generate the site on the same thread

esbanarango opened this issue · 0 comments

Hello and thank you for this project.

At Envoy we are using rack-jekyll to test our jekyll site with RSpec and Capybara. We want to build the site every time we run the tests and put it on an specific directory (if it doesn't exist already). But building the site takes some time and as it's running on a separate thread by the time we run RSspec and Capybara tests the site isn't ready.

spec_helper.rb
require 'rspec'
require 'capybara/rspec'
require 'rack/jekyll'
require 'rack/test'
WebMock.allow_net_connect!

RSpec.configure do |config|
  # ...
  # Configure Capybara to load the website through rack-jekyll.
  # (force_build: true) builds the site before the tests are run,
  # so our tests are always running against the latest version
  # of our jekyll site.
  Capybara.app = Rack::Jekyll.new(force_build: true, config: '_test_config.yml')
end