Skip to content

Instantly share code, notes, and snippets.

@alexandru-calinoiu
Created October 4, 2012 19:53
Show Gist options
  • Select an option

  • Save alexandru-calinoiu/3835987 to your computer and use it in GitHub Desktop.

Select an option

Save alexandru-calinoiu/3835987 to your computer and use it in GitHub Desktop.
General layout:
root
lib
hw1
part1.rb
spec
hw1
part1_spec.rb
.rspec
Guardfile
You will need the following gems
rspec
guard
guard-rspec
# lib\rspec_helper
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), ".."))
(1..1).each do |i|
$: << File.join(APP_ROOT, "lib/hw#{i}")
end
RSpec.configure do |config|
# ## Mock Framework
#
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
#
# config.mock_with :mocha
# config.mock_with :flexmock
# config.mock_with :rr
end
# .\Guardfile
# More info at https://github.com/guard/guard#readme
guard 'rspec', :version => 2 do
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
watch('spec/spec_helper.rb') { "spec" }
end
# .\.rspec
--color
now simply type `guard` in your console in the root folder and go solve the problems.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment