项目作者: vkinelev

项目描述 :
Benchmark Rails Fixtures vs fabrication
高级语言: Ruby
项目地址: git://github.com/vkinelev/rails-fixtures-benchmark.git
创建时间: 2017-09-25T21:02:05Z
项目社区:https://github.com/vkinelev/rails-fixtures-benchmark

开源协议:

下载


README

Compare performance of fixtures vs an inline creation of objects in tests

An app has two very similar models: Artist and Product. The first one is tested
with fixtures, while the second one is tested with objects created right in
the tests with regular ActiveRecord create! methods. A test is launched 500 times
for the every model.

To run tests:

  1. rails test test/models/artist_test.rb
  2. rails test test/models/product_test.rb

A sample output:

  1. ...
  2. Finished in 0.312112s, 1601.9882 runs/s, 1601.9882 assertions/s.
  3. 500 runs, 500 assertions, 0 failures, 0 errors, 0 skips
  4. ...
  5. Finished in 1.355958s, 368.7429 runs/s, 368.7429 assertions/s.
  6. 500 runs, 500 assertions, 0 failures, 0 errors, 0 skips