lib/atp/validator.rb in atp-0.8.0 vs lib/atp/validator.rb in atp-1.0.0
- old
+ new
@@ -1,10 +1,18 @@
require 'ast'
module ATP
class Validator < Processor
attr_reader :flow
+ def self.testing=(value)
+ @testing = value
+ end
+
+ def self.testing
+ @testing
+ end
+
def initialize(flow)
@flow = flow
end
def process(node)
@@ -27,8 +35,19 @@
process(node)
on_completion
end
def setup
+ end
+
+ def error(message)
+ # This is a hack to make the specs pass, for some reason RSpec
+ # seems to be swallowing the Origen log output after the first
+ # test that generates an error
+ if Validator.testing
+ puts message
+ else
+ Origen.log.error(message)
+ end
end
end
end