Sha256: 568b06b369f7493cd7524697d99c695ef909ffad1f73219845d7d9db32ee93de

Contents?: true

Size: 611 Bytes

Versions: 1

Compression:

Stored size: 611 Bytes

Contents

module FactoryGirlProfiling
  class Initializer
    def self.initialize_rspec
      RSpec.configure do |config|
        if ENV['PROFILE_FACTORY_GIRL']
          config.before(:suite) do
            ActiveSupport::Notifications.subscribe("factory_girl.run_factory") do |name, start, finish, id, payload|
              FactoryGirlProfiling::Profiler.add(name, start, finish, id, payload)
            end
          end

          config.after(:suite) do
            FactoryGirlProfiling::Profiler.print_results
            FactoryGirlProfiling::Profiler.reset
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
factory_girl_profiling-0.0.1 lib/factory_girl_profiling/initializer.rb