Skip to content

Commit

Permalink
Merge pull request #2 from ConorSheehan1/develop
Browse files Browse the repository at this point in the history
remove_rack_jekyll
  • Loading branch information
ConorSheehan1 authored Dec 19, 2018
2 parents 39aa81d + df0168d commit 89050eb
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 196 deletions.
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.4.4
2.5.3
35 changes: 21 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,29 @@
# match https://pages.github.com/versions/
os: linux
sudo: required
env: DISPLAY=':99.0'
dist: trusty
dist: xenial
addons:
apt:
sources:
- google-chrome
packages:
- google-chrome-stable
chrome: stable

language: ruby
cache: bundler
rvm:
- 2.4.4

install:
- bundle install # install dependencies

before_script:
- bundle install
- bundle exec jekyll serve & # start a Web server (use & to start in new process)
- sleep 3 # give Web server some time to bind to sockets, etc

script:
- bundle exec rspec
- bundle exec rubocop
matrix:
# finish build even if rubocop is still running
fast_finish: true
include:
- rvm: 2.5.3
script:
- bundle exec rspec
- rvm: 2.4.4
script:
- bundle exec rubocop
# allow rubocop to fail
allow_failures:
- rvm: 2.4.4
6 changes: 1 addition & 5 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@ source 'https://rubygems.org'

group :development, :test do
gem 'byebug', '~> 10.0'
gem 'jekyll', '>= 3.6.3'
gem 'rack', '>= 2.0.6'
# https://github.com/adaoraul/rack-jekyll/issues/56
gem 'rack-jekyll', git: 'https://github.com/adaoraul/rack-jekyll',
ref: 'e6ae4a588c2d881bccc35368e9cc81fe745a2b99'
gem 'jekyll', '~> 3.7.4'
gem 'rubocop', '~> 0.57.2'
end

Expand Down
16 changes: 2 additions & 14 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
GIT
remote: https://github.com/adaoraul/rack-jekyll
revision: e6ae4a588c2d881bccc35368e9cc81fe745a2b99
ref: e6ae4a588c2d881bccc35368e9cc81fe745a2b99
specs:
rack-jekyll (0.5.0)
jekyll (>= 1.3)
listen (>= 1.3)
rack (>= 1.5)

GEM
remote: https://rubygems.org/
specs:
Expand Down Expand Up @@ -312,10 +302,8 @@ DEPENDENCIES
chromedriver-helper (~> 1.1.0)
faraday (~> 0.13.1)
github-pages
jekyll (>= 3.6.3)
jekyll (~> 3.7.4)
jekyll-paginate (~> 1.1)
rack (>= 2.0.6)
rack-jekyll!
rspec (~> 3.7.0)
rubocop (~> 0.57.2)
selenium-webdriver (~> 3.8)
Expand All @@ -324,4 +312,4 @@ RUBY VERSION
ruby 2.3.0p0

BUNDLED WITH
1.17.1
1.17.2
160 changes: 5 additions & 155 deletions LICENSE.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[![Build Status](https://travis-ci.org/ConorSheehan1/ConorSheehan1.github.io.svg?branch=master)](https://travis-ci.org/ConorSheehan1/ConorSheehan1.github.io)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

## Local setup
1. install dependencies
Expand Down
3 changes: 1 addition & 2 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ exclude:
- vendor/*

jstree_theme: "default-dark"
# jstree_theme: "proton"

sass:
sass_dir: ./_scss
sass_dir: _scss
27 changes: 22 additions & 5 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@

require 'rspec'
require 'capybara/rspec'
require 'rack/jekyll'
require 'rack/test'
require 'yaml'
require 'faraday'
require 'selenium/webdriver'

Dir["#{__dir__}/support/**/*.rb"].each { |f| require f }

Expand All @@ -23,13 +22,31 @@
mocks.verify_partial_doubles = true
end

Capybara.register_driver :selenium do |app|
Capybara::Selenium::Driver.new(app, browser: :chrome)
Capybara.register_driver :headless_chrome do |app|
capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(
chromeOptions: { args: %w[headless disable-gpu no-sandbox port=4000] }
)

Capybara::Selenium::Driver.new app,
browser: :chrome,
desired_capabilities: capabilities
end

Capybara.configure do |cap|
cap.current_driver = :headless_chrome
cap.javascript_driver = :headless_chrome
cap.run_server = false
cap.app_host = 'http://127.0.0.1:4000'
end

# rubocop:disable Metrics/LineLength
# https://gist.github.com/deanmarano/aeae5cd2d357fec1b06e30ead397d4e3
# Configure Capybara to load the website through rack-jekyll.
# (force_build: true) builds the site before the tests are run,
# so the tests are always running against the latest version of the site.
Capybara.app = Rack::Jekyll.new(force_build: true)

# Capybara.app = Rack::Jekyll.new(force_build: true, config: "#{__dir__}/../_config.yml")
# force build not reading _config.yml? raising exception
# cannot load such file -- ConorSheehan1.github.io/_layouts/spec/data/images_spec.rb
# rubocop:enable Metrics/LineLength
end

0 comments on commit 89050eb

Please sign in to comment.