-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Snippet is a self-contained example that defines the configuration, Rails project code and specs to run. It: - allows for clean separation between different snippets - works quite fast - reuses the already installed gems In theory snippets retain the ability to use generators and arbitrary commands, but it makes the case under test less evident.
- Loading branch information
Showing
4 changed files
with
55 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
require "bundler/inline" | ||
|
||
gemfile(true) do | ||
source "https://rubygems.org" | ||
|
||
git_source(:github) { |repo| "https://github.com/#{repo}.git" } | ||
|
||
# Those Gemfiles carefully pick the right versions depending on | ||
# settings in the ENV, `.rails-version` and `maintenance-branch`. | ||
eval_gemfile 'Gemfile-rspec-dependencies' | ||
eval_gemfile 'Gemfile-rails-dependencies' | ||
|
||
gem "rspec-rails", path: "./" | ||
gem "sqlite3" | ||
gem "ammeter" | ||
end | ||
|
||
# Initialization | ||
require "active_record/railtie" | ||
require "rspec/rails" | ||
|
||
# Run specs on exit | ||
require "rspec/autorun" | ||
|
||
# RSpec configuration | ||
RSpec.configure do |config| | ||
config.use_active_record = false | ||
end | ||
|
||
# Rails project code | ||
class Command | ||
end | ||
|
||
# Rails project specs | ||
RSpec.describe Command do | ||
it 'does not not break' do | ||
Command.new | ||
end | ||
end |