Skip to content

Commit

Permalink
Add rspec config for spring, else it doesn't work
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesjefferies committed Jan 26, 2017
1 parent 651dce2 commit 02bcb1d
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 16 deletions.
1 change: 1 addition & 0 deletions Gemfile
Expand Up @@ -64,6 +64,7 @@ group :doc do
end

group :development do
gem 'spring-commands-rspec'
gem 'pry-remote'
gem 'letter_opener'
gem 'term-ansicolor'
Expand Down
13 changes: 8 additions & 5 deletions Gemfile.lock
Expand Up @@ -105,7 +105,7 @@ GEM
bootstrap_form (2.5.3)
buftok (0.2.0)
builder (3.2.3)
capybara (2.11.0)
capybara (2.12.0)
addressable
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
Expand All @@ -123,7 +123,7 @@ GEM
colorize (0.8.1)
concurrent-ruby (1.0.4)
connection_pool (2.2.1)
coveralls (0.8.18)
coveralls (0.8.19)
json (>= 1.8, < 3)
simplecov (~> 0.12.0)
term-ansicolor (~> 1.3)
Expand Down Expand Up @@ -296,7 +296,7 @@ GEM
omniauth (~> 1.2)
open_uri_redirections (0.2.1)
pg (0.19.0)
poltergeist (1.12.0)
poltergeist (1.13.0)
capybara (~> 2.1)
cliver (~> 0.3.1)
websocket-driver (>= 0.2.0)
Expand Down Expand Up @@ -412,8 +412,10 @@ GEM
simplecov-html (~> 0.10.0)
simplecov-html (0.10.0)
slop (3.6.0)
spring (2.0.0)
spring (2.0.1)
activesupport (>= 4.2)
spring-commands-rspec (1.0.4)
spring (>= 0.9.1)
sprockets (3.7.1)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
Expand Down Expand Up @@ -459,7 +461,7 @@ GEM
addressable (>= 2.3.6)
crack (>= 0.3.2)
hashdiff
websocket-driver (0.6.4)
websocket-driver (0.6.5)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.2)
will_paginate (3.1.5)
Expand Down Expand Up @@ -526,6 +528,7 @@ DEPENDENCIES
sdoc (~> 0.4.0)
sidekiq
spring
spring-commands-rspec
term-ansicolor
terminal-notifier-guard (~> 1.6.1)
twitter
Expand Down
5 changes: 5 additions & 0 deletions bin/rails
@@ -1,4 +1,9 @@
#!/usr/bin/env ruby
begin
load File.expand_path('../spring', __FILE__)
rescue LoadError => e
raise unless e.message.include?('spring')
end
APP_PATH = File.expand_path('../config/application', __dir__)
require_relative '../config/boot'
require 'rails/commands'
5 changes: 5 additions & 0 deletions bin/rake
@@ -1,4 +1,9 @@
#!/usr/bin/env ruby
begin
load File.expand_path('../spring', __FILE__)
rescue LoadError => e
raise unless e.message.include?('spring')
end
require_relative '../config/boot'
require 'rake'
Rake.application.run
8 changes: 8 additions & 0 deletions bin/rspec
@@ -0,0 +1,8 @@
#!/usr/bin/env ruby
begin
load File.expand_path('../spring', __FILE__)
rescue LoadError => e
raise unless e.message.include?('spring')
end
require 'bundler/setup'
load Gem.bin_path('rspec-core', 'rspec')
21 changes: 10 additions & 11 deletions bin/spring
@@ -1,18 +1,17 @@
#!/usr/bin/env ruby

# This file loads spring without using Bundler, in order to be fast
# It gets overwritten when you run the `spring binstub` command
# This file loads spring without using Bundler, in order to be fast.
# It gets overwritten when you run the `spring binstub` command.

unless defined?(Spring)
require "rubygems"
require "bundler"
require 'rubygems'
require 'bundler'

if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ spring \((.*?)\)$.*?^$/m)
ENV["GEM_PATH"] = ([Bundler.bundle_path.to_s] + Gem.path).join(File::PATH_SEPARATOR)
ENV["GEM_HOME"] = ""
Gem.paths = ENV

gem "spring", match[1]
require "spring/binstub"
lockfile = Bundler::LockfileParser.new(Bundler.default_lockfile.read)
spring = lockfile.specs.detect { |spec| spec.name == "spring" }
if spring
Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path
gem 'spring', spring.version
require 'spring/binstub'
end
end

0 comments on commit 02bcb1d

Please sign in to comment.