Permalink
Browse files

Add a class option to TestBackgroundProcessor to commit immediately

defaults to the old behavior (delay and add to commits) but
allows test to force commands to process immediately
  • Loading branch information...
1 parent 06351dc commit bb90619e8c0c3f1dfc5e236c5009203923fceacd @karmajunkie committed Jan 2, 2013
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/imperator/test_background_processor.rb
@@ -2,10 +2,11 @@ class Imperator::TestBackgroundProcessor
@commits = []
class << self
attr_accessor :commits
+ attr_accessor :commit_mode
end
def self.commit(command, options = nil)
@commits << command
- command.perform!
+ command.perform! if self.commit_mode == :immediate
end
end

0 comments on commit bb90619

Please sign in to comment.