Skip to content

Commit add848a

Browse files
authored
Merge pull request #23 from tf/ci
Setup page type lint specs
2 parents 61a88a0 + 7643594 commit add848a

File tree

7 files changed

+62
-0
lines changed

7 files changed

+62
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ lib/bundler/man
1313
pkg
1414
rdoc
1515
spec/reports
16+
spec/dummy
1617
test/tmp
1718
test/version_tmp
1819
tmp

.travis.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
language: ruby
2+
rvm: 2.5
3+
4+
# User container based travis infrastructure which allows caching
5+
# features for open source projects.
6+
sudo: false
7+
cache: bundler
8+
9+
script:
10+
- bin/rspec

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Pageflow Before After
22

33
[![Gem Version](https://badge.fury.io/rb/pageflow-before-after.svg)](http://badge.fury.io/rb/pageflow-before-after)
4+
[![Build Status](https://travis-ci.org/codevise/pageflow-before-after.svg?branch=master)](https://travis-ci.org/codevise/pageflow-before-after)
45

56
Page type showing before/after image sliders (Digit style).
67

bin/rspec

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
3+
4+
#
5+
# This file was generated by Bundler.
6+
#
7+
# The application 'rspec' is installed as part of a gem, and
8+
# this file is here to facilitate running it.
9+
#
10+
11+
require "pathname"
12+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13+
Pathname.new(__FILE__).realpath)
14+
15+
bundle_binstub = File.expand_path("../bundle", __FILE__)
16+
17+
if File.file?(bundle_binstub)
18+
if File.read(bundle_binstub, 150) =~ /This file was generated by Bundler/
19+
load(bundle_binstub)
20+
else
21+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
22+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
23+
end
24+
end
25+
26+
require "rubygems"
27+
require "bundler/setup"
28+
29+
load Gem.bin_path("rspec-core", "rspec")

pageflow-before-after.gemspec

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ Gem::Specification.new do |spec|
2323

2424
spec.add_dependency 'jquery-ui-rails', '~> 5.0'
2525

26+
spec.add_development_dependency 'pageflow-support', '~> 13.6.x'
27+
spec.add_development_dependency 'rspec-rails', '~> 3.0'
28+
2629
# Semantic versioning rake tasks
2730
spec.add_development_dependency 'semmy', '~> 1.0'
2831
end

spec/integration/page_type_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
require 'spec_helper'
2+
require 'pageflow/lint'
3+
4+
Pageflow::Lint.page_type(Pageflow::BeforeAfter.page_type)

spec/spec_helper.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
ENV['RAILS_ENV'] ||= 'test'
2+
ENV['PAGEFLOW_PLUGIN_ENGINE'] = 'pageflow_before_after'
3+
4+
require 'pageflow/support'
5+
Pageflow::Dummy.setup
6+
7+
require 'rspec/rails'
8+
9+
engine_root = File.join(File.dirname(__FILE__), '..')
10+
Dir[File.join(engine_root, 'spec/support/**/*.rb')].each { |file| require(file) }
11+
12+
RSpec.configure do |config|
13+
config.use_transactional_fixtures = true
14+
end

0 commit comments

Comments
 (0)