Skip to content

Commit

Permalink
Setup page type lint specs
Browse files Browse the repository at this point in the history
REDMINE-16580
  • Loading branch information
tf committed Mar 7, 2019
1 parent 254a699 commit ee635ae
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ lib/bundler/man
pkg
rdoc
spec/reports
spec/dummy
test/tmp
test/version_tmp
tmp
Expand Down
10 changes: 10 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
language: ruby
rvm: 2.5

# User container based travis infrastructure which allows caching
# features for open source projects.
sudo: false
cache: bundler

script:
- bin/rspec
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Pageflow Text Page

[![Gem Version](https://badge.fury.io/rb/pageflow-text-page.svg)](http://badge.fury.io/rb/pageflow-text-page)
[![Build Status](https://travis-ci.org/codevise/pageflow-text-page.svg?branch=master)](https://travis-ci.org/codevise/pageflow-text-page)

Page type to display large texts on a page.

Expand Down
29 changes: 29 additions & 0 deletions bin/rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

#
# This file was generated by Bundler.
#
# The application 'rspec' is installed as part of a gem, and
# this file is here to facilitate running it.
#

require "pathname"
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)

bundle_binstub = File.expand_path("../bundle", __FILE__)

if File.file?(bundle_binstub)
if File.read(bundle_binstub, 150) =~ /This file was generated by Bundler/
load(bundle_binstub)
else
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
end
end

require "rubygems"
require "bundler/setup"

load Gem.bin_path("rspec-core", "rspec")
4 changes: 3 additions & 1 deletion pageflow-text-page.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ Gem::Specification.new do |spec|
spec.add_runtime_dependency 'pageflow', ['>= 12.2.x', '< 14']
spec.add_runtime_dependency 'pageflow-public-i18n', '~> 1.0'

spec.add_development_dependency 'bundler', '~> 1.0'
spec.add_development_dependency 'bundler', ['>= 1.0', '< 3']
spec.add_development_dependency 'pageflow-support', '~> 13.6.x'
spec.add_development_dependency 'rake', '~> 12.0'
spec.add_development_dependency 'rspec-rails', '~> 3.0'

# Semantic versioning rake tasks
spec.add_development_dependency 'semmy', '~> 1.0'
Expand Down
4 changes: 4 additions & 0 deletions spec/integration/page_type_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
require 'spec_helper'
require 'pageflow/lint'

Pageflow::Lint.page_type(Pageflow::TextPage.page_type)
14 changes: 14 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
ENV['RAILS_ENV'] ||= 'test'
ENV['PAGEFLOW_PLUGIN_ENGINE'] = 'pageflow_text_page'

require 'pageflow/support'
Pageflow::Dummy.setup

require 'rspec/rails'

engine_root = File.join(File.dirname(__FILE__), '..')
Dir[File.join(engine_root, 'spec/support/**/*.rb')].each { |file| require(file) }

RSpec.configure do |config|
config.use_transactional_fixtures = true
end

0 comments on commit ee635ae

Please sign in to comment.