From bd27009f4382b9625af07caac539dba1001bd697 Mon Sep 17 00:00:00 2001 From: Aaron Suggs Date: Fri, 18 Dec 2015 08:54:19 -0500 Subject: [PATCH 1/2] Add Guard testing support While developing rack-attack, run tests continuously with `bundle exec guard` --- Gemfile | 9 +++++++-- Guardfile | 10 ++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 Guardfile diff --git a/Gemfile b/Gemfile index 41e7aff..5d00c12 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,9 @@ -source "https://rubygems.org" +source 'https://rubygems.org' + gemspec -#gem 'debugger', platform: 'ruby' +group :development do + gem 'pry' + gem 'guard' # NB: this is necessary in newer versions + gem 'guard-minitest' +end diff --git a/Guardfile b/Guardfile new file mode 100644 index 0000000..ebf900b --- /dev/null +++ b/Guardfile @@ -0,0 +1,10 @@ +# A sample Guardfile +# More info at https://github.com/guard/guard#readme + +guard :minitest do + # with Minitest::Spec + watch(%r{^spec/(.*)_spec\.rb$}) + watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" } + watch(%r{^spec/spec_helper\.rb$}) { 'spec' } +end + From 11faea4526b262619533944880666177870dd671 Mon Sep 17 00:00:00 2001 From: Aaron Suggs Date: Fri, 18 Dec 2015 08:55:09 -0500 Subject: [PATCH 2/2] specs: use pry instead of debugger --- spec/spec_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index dec8563..5382087 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -8,9 +8,9 @@ require 'active_support' require "rack/attack" begin - require 'debugger' + require 'pry' rescue LoadError - #nothing to do here + #nothing to do here end class MiniTest::Spec