Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

…esting
  • Loading branch information...
commit 5c09e44d3e249aa5ea2fa28ad2d8657689c5b13d 1 parent 5ffbf6f
@ezkl ezkl authored
View
2  .rspec
@@ -0,0 +1,2 @@
+--color
+--format progress
View
5 Guardfile
@@ -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
View
2  spec/sax-machine/configure_sax_machine_spec.rb
@@ -1,4 +1,4 @@
-require 'spec_helper'
+require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
class A
View
2  spec/sax-machine/include_sax_machine_spec.rb
@@ -1,4 +1,4 @@
-require 'spec_helper'
+require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
class A
include SAXMachine
View
2  spec/sax-machine/sax_document_spec.rb
@@ -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
20 spec/spec_helper.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.