Skip to content

Instantly share code, notes, and snippets.

@CheezItMan
Created April 13, 2017 17:39
Show Gist options
  • Save CheezItMan/381344fc4655ff22c28fe24ecaf01917 to your computer and use it in GitHub Desktop.
Save CheezItMan/381344fc4655ff22c28fe24ecaf01917 to your computer and use it in GitHub Desktop.
# Gems we've talked about in class, but which have absolutely nothing to do
# with setting up spec-style testing.
# Included here for convenience.
gem_group :development do
# Improve the error message you get in the browser
gem 'better_errors'
# Use pry for rails console
gem 'pry-rails'
end
gem 'awesome_print'
gem 'foundation-rails'
# Add some extra minitest support
gem_group :test do
gem 'minitest-rails'
gem 'minitest-reporters'
end
# Add some code to some files to support spec-style testing
# For these injections, indentation matters!
inject_into_file 'config/application.rb', after: "class Application < Rails::Application\n" do
<<-'RUBY'
# Force new test files to be generated in the minitest-spec style
config.generators do |g|
g.test_framework :minitest, spec: true
end
RUBY
end
# Things to do after all the gems have been installed
after_bundle do
# Run rails generate minitest:install
generate "minitest:install", "--force"
# Run rails generate foundation:install
generate "foundation:install", "--force"
# Add minitest reporters support. This must be run after
# rails generate minitest:install, because that command
# changes test/test_helper.rb
inject_into_file 'test/test_helper.rb', after: 'require "minitest/rails"' do
<<-'RUBY'
require "minitest/reporters" # for Colorized output
# For colorful output!
Minitest::Reporters.use!(
Minitest::Reporters::SpecReporter.new,
ENV,
Minitest.backtrace_filter
)
RUBY
end
# Add Foundation Javascript with Motion-ui this must be run after
# rails generate foundation:install, because that command
# adds foundation_and_overrides.scss
inject_into_file 'app/assets/stylesheets/foundation_and_overrides.scss', after: '// @include motion-ui-animations;' do
<<-'RUBY'
@import 'motion-ui/motion-ui';
@include motion-ui-transitions;
@include motion-ui-animations;
RUBY
end
end
@droberts-sea
Copy link

Looks like you're missing the binding_of_caller gem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment