Permalink
Browse files

Update RSpec implementation, add Guard and simplecov for easy local t…

…esting
  • Loading branch information...
1 parent 5ffbf6f commit 5c09e44d3e249aa5ea2fa28ad2d8657689c5b13d @ezkl ezkl committed May 23, 2012
View
2 .rspec
@@ -0,0 +1,2 @@
+--color
+--format progress
View
@@ -0,0 +1,5 @@
+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
@@ -1,4 +1,4 @@
-require 'spec_helper'
+require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
class A
@@ -1,4 +1,4 @@
-require 'spec_helper'
+require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
class A
include SAXMachine
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../spec_helper'
+require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe "SAXMachine" do
describe "element" do
View
@@ -1,11 +1,15 @@
-require 'date'
-
-# gem install redgreen for colored test output
-begin require "redgreen" unless ENV['TM_CURRENT_LINE']
- rescue LoadError
+begin
+ require 'simplecov'
+ SimpleCov.start do
+ add_filter "/spec/"
+ end
+rescue LoadError
end
-path = File.expand_path(File.dirname(__FILE__) + "/../lib/")
-$LOAD_PATH.unshift(path) unless $LOAD_PATH.include?(path)
+require File.expand_path(File.dirname(__FILE__) + '/../lib/sax-machine')
-require "sax-machine"
+RSpec.configure do |config|
+ config.treat_symbols_as_metadata_keys_with_true_values = true
+ config.run_all_when_everything_filtered = true
+ config.filter_run :focus
+end

0 comments on commit 5c09e44

Please sign in to comment.