Last active
January 27, 2016 00:11
-
-
Save Yorkshireman/c02a62072d0cca51e386 to your computer and use it in GitHub Desktop.
spec_helper and Gemfile from a Padrino app. This successfully runs RSpec/Capybara Unit/Feature tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'https://rubygems.org' | |
# Padrino supports Ruby version 1.9 and later | |
ruby '2.3.0' | |
# Project requirements | |
gem 'rake' | |
# Component requirements | |
gem 'bcrypt' | |
gem 'sass' | |
gem 'haml' | |
gem 'activerecord', '>= 3.1', :require => 'active_record' | |
gem 'sqlite3' | |
# Test requirements | |
group :test do | |
gem 'shoulda' | |
gem 'rack-test', :require => 'rack/test' | |
gem 'rspec-padrino' | |
gem 'capybara' | |
end | |
# Padrino Stable Gem | |
gem 'padrino', '0.13.1' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RACK_ENV = 'test' unless defined?(RACK_ENV) | |
require File.expand_path(File.dirname(__FILE__) + "/../config/boot") | |
Dir[File.expand_path(File.dirname(__FILE__) + "/../app/helpers/**/*.rb")].each(&method(:require)) | |
require 'rack/test' | |
require 'rspec/padrino' | |
require 'capybara/rspec' | |
Capybara.app = Padrino.application | |
RSpec.configure do |config| | |
config.include Rack::Test::Methods | |
config.include RSpec::Padrino | |
config.include Capybara::DSL | |
config.expect_with :rspec do |expectations| | |
expectations.include_chain_clauses_in_custom_matcher_descriptions = true | |
end | |
config.mock_with :rspec do |mocks| | |
mocks.verify_partial_doubles = true | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment