Skip to content

Commit

Permalink
fix autotest. mock with mocha
Browse files Browse the repository at this point in the history
  • Loading branch information
mislav committed May 1, 2008
1 parent 02703de commit ff658ec
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 32 deletions.
30 changes: 30 additions & 0 deletions .autotest
@@ -0,0 +1,30 @@
# vi:ft=ruby:
Autotest.add_hook :initialize do |at|

%w{ vendor/gems/ .git stories/ Rakefile Capfile README .autotest spec/spec.opts spec/rcov.opts }.each do |exception|
at.add_exception exception
end


at.add_mapping(/spec\/defaults.rb/) do |f, _|
at.files_matching %r%^spec/(controllers|helpers|lib|models|views)/.*\.rb$%
end

end

class Autotest
def exceptions_non_greedy
unless defined? @exceptions then
if @exception_list.empty? then
@exceptions = nil
else
@exceptions = /^\.\/#{Regexp.union(*@exception_list)}/
end
end

@exceptions
end

alias :exceptions_original :exceptions
alias :exceptions :exceptions_non_greedy
end
34 changes: 2 additions & 32 deletions spec/spec_helper.rb
Expand Up @@ -6,42 +6,12 @@
require 'spec/rails'

Spec::Runner.configure do |config|
# If you're not using ActiveRecord you should remove these
# lines, delete config/database.yml and disable :active_record
# in your config/boot.rb
config.use_transactional_fixtures = true
config.use_instantiated_fixtures = false
config.fixture_path = RAILS_ROOT + '/spec/fixtures/'

# == Fixtures
#
# You can declare fixtures for each example_group like this:
# describe "...." do
# fixtures :table_a, :table_b
#
# Alternatively, if you prefer to declare them only once, you can
# do so right here. Just uncomment the next line and replace the fixture
# names with your fixtures.
#
# config.global_fixtures = :table_a, :table_b
#
# If you declare global fixtures, be aware that they will be declared
# for all of your examples, even those that don't use them.
#
# You can also declare which fixtures to use (for example fixtures for test/fixtures):
#
# config.fixture_path = RAILS_ROOT + '/spec/fixtures/'
#
# == Mock Framework
#
# RSpec uses it's own mocking framework by default. 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
#
# == Notes
#
# For more information take a look at Spec::Example::Configuration and Spec::Runner

config.mock_with :mocha
end

0 comments on commit ff658ec

Please sign in to comment.