Skip to content

Commit

Permalink
fix failing test case
Browse files Browse the repository at this point in the history
  • Loading branch information
sinisterchipmunk committed Sep 7, 2016
1 parent 8239c5a commit 5ef999a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/rspec-prof.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,21 @@ def save_to filename
end

RSpec.configure do |config|
profiler = nil

config.before(:suite) do
unless ['all', 'each', ''].include?(ENV['RSPEC_PROFILE'].to_s)
raise "ENV['RSPEC_PROFILE'] should be blank, 'all' or 'each', but was '#{ENV['RSPEC_PROFILE']}'"
end

if ENV['RSPEC_PROFILE'] == 'all'
@profiler = RSpecProf.new.start
profiler = RSpecProf.new.start
end
end

config.after(:suite) do
if ENV['RSPEC_PROFILE'] == 'all'
@profiler.save_to "#{RSpecProf.output_dir}/all.#{RSpecProf.file_extension}"
profiler.save_to "#{RSpecProf.output_dir}/all.#{RSpecProf.file_extension}"
end
end

Expand Down

0 comments on commit 5ef999a

Please sign in to comment.