up the development environment" # ... build :raise_on_delivery_errors # ... end end end module Suspenders class AppBuilder < Rails::AppBuilder include Suspenders::Actions def raise_on_delivery_errors replace_in_file "config/environments/development.rb", "raise_delivery_errors = false", "raise_delivery_errors = true" end end end
Generators::Base def simplecov_gem gem "simplecov", require: false, group: [:test] Bundler.with_unbundled_env { run "bundle install" } end def simplecov_test_integration prepend_template_to_file(test_helper_file, "partials/ci_simplecov.rb") end end end
default configuration", type: :feature do before(:all) do drop_dummy_database clear_tmp_directory run_suspenders setup_app_dependencies end it "uses custom Gemfile" it "ensures project specs pass" it "adds bin/setup file" it "makes bin/setup executable" it "includes the bundle:audit task" # ... end
"invoke" do it "bundles the standardrb gem" do with_fake_app do invoke! Suspenders::LintGenerator expect("Gemfile") .to match_contents(/gem .standard./) .and have_no_syntax_error end end end end
FakeBundler.stub_unbundled_env!(self, path: path) execute = lambda do clear_tmp_directory create_fake_app_dir Dir.chdir(app_path) { yield } end if @no_silence execute.call else OutputStub.silence { execute.call } end end end
standardrb gem from Gemfile" do with_fake_app do invoke_then_revoke! Suspenders::LintGenerator expect("Gemfile") .to not_match_contents(/gem .standard./) .and have_no_syntax_error end end it "removes the standardrb rake tasks from rake" do with_fake_app do invoke_then_revoke! Suspenders::LintGenerator expect(`rake -T`).to be_empty end end end