lib/rspec/apib.rb in rspec-apib-0.3.1 vs lib/rspec/apib.rb in rspec-apib-0.3.2
- old
+ new
@@ -23,12 +23,13 @@
def start
types = config.record_types
RSpec.configure do |config|
config.after :each do |example|
- return if example.metadata[:apib] === false
- return unless types.include?(example.metadata[:type])
- RSpec::Apib.record(example, request, response, @routes)
+ if types.include?(example.metadata[:type]) &&
+ !(example.metadata[:apib] === false)
+ RSpec::Apib.record(example, request, response, @routes)
+ end
end
config.after :all do |example|
RSpec::Apib.write
end