factory_girl_instruments 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 61b1b0370431833b8d454eedd3e58f3f5107984d
4
- data.tar.gz: a547df695405976256b24d735956cebc7e6a5b5e
3
+ metadata.gz: 879c33a8388c6c44c438c4e7df09d4d3b591071e
4
+ data.tar.gz: b9484cc6cb157939d0a7f9e16e60c1aad07e3e8c
5
5
  SHA512:
6
- metadata.gz: bf4d4cbef3bc8abe25d7da3b6a56ab67f1cd3597abc3cb069b38b0b80484b8abd9d45e26de7598e5a0fa2afe1347fbc70f959c2a8fded348ec846819354bd000
7
- data.tar.gz: bccbe9dfa46b3d7ff929b52b219eaa4fa03bcae7c035b4d55a7879eaf20743e5769f319dbac4bb77277bd3b933084987d2e8c3b1cf78187b88e4330082ca592d
6
+ metadata.gz: bbe25d0736d0c3a37fb8dfeec06d67be84134a7e13d77d3d2ab619909b1b20ba58a3b57abe048f78f8527ce59530f95635110af1289510c82367cd78d3c9205a
7
+ data.tar.gz: 7275eed01ca7c4b87bfae5a89a55f3ae3a050140b67c7ae2d920eb0ff889e9b34b7427202f40d7626aeda9528927e9ba9be0de0181d4f93ab9b56eddb7d9071f
data/README.md CHANGED
@@ -1,8 +1,10 @@
1
1
  # Factory Girl Instruments
2
2
 
3
3
  [![Build Status](https://semaphoreci.com/api/v1/shiroyasha/factory_girl_instruments/branches/master/badge.svg)](https://semaphoreci.com/shiroyasha/factory_girl_instruments)
4
+ [![Gem Version](https://badge.fury.io/rb/factory_girl_instruments.svg)](https://badge.fury.io/rb/factory_girl_instruments)
4
5
 
5
- Instruments for benchmarking, tracing, and debugging Factory Girl models.
6
+ Instruments for benchmarking, tracing, and debugging
7
+ [Factory Girl](https://github.com/thoughtbot/factory_girl) models.
6
8
 
7
9
  Table of content:
8
10
 
@@ -11,6 +13,32 @@ Table of content:
11
13
  - [Benchmark all Factories](#benchmarking-all-factory-girl-models)
12
14
  - [Trace Factory Girl calls](#tracing-factory-girl-calls)
13
15
 
16
+ ## Purpose of this gem
17
+
18
+ Factory Girl is probably the base of your Rails test suite, but how deeply you
19
+ understand the models and the associations that are created in your tests?
20
+
21
+ Factory Girl Instruments help in these three aspects:
22
+
23
+ 1. Slow test suites: Factory Girl is used for the bulk of tests in Rails. Even a
24
+ small performance improvement in one of your factories can dramatically
25
+ improve the speed of your overall test suite.
26
+
27
+ Hint: Run `FactoryGirl.benchmark_all`.
28
+
29
+ 2. Deeper understanding of the database state: By tracing factory girl and SQL
30
+ calls you can get a deeper understanding of what is actually created in your
31
+ tests, helping you to debug the issues faster.
32
+
33
+ Hint: Run `FactoryGirl.trace { FactoryGirl.create(:user) }`.
34
+
35
+ 3. Find issues with missconfigured factories: When a factory is properly set up
36
+ it is a bliss to work with it. However, if there is a hidden deep in the
37
+ association chain debugging the created model can be a hellish experience.
38
+
39
+ Hint: Run `FactoryGirl.trace { FactoryGirl.create(:user) }` and observe the
40
+ chain of calls.
41
+
14
42
  ## Install
15
43
 
16
44
  Add the following to your Gemfile:
@@ -37,7 +65,7 @@ If you have a `user` factory, you can benchmark it with:
37
65
  FactoryGirl.benchmark(:user)
38
66
  ```
39
67
 
40
- By default, the `FactoryGirl.crete(<model>)` is called. You can pass `:method`
68
+ By default, the `FactoryGirl.create(<model>)` is called. You can pass `:method`
41
69
  to override this:
42
70
 
43
71
  ``` ruby
@@ -1,3 +1,3 @@
1
1
  module FactoryGirlInstruments
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: factory_girl_instruments
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Šarčević
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-05-03 00:00:00.000000000 Z
11
+ date: 2017-05-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: factory_girl
@@ -111,7 +111,6 @@ files:
111
111
  - bin/console
112
112
  - bin/setup
113
113
  - factory_girl_instruments.gemspec
114
- - factory_girl_instruments_test.db
115
114
  - lib/factory_girl_instruments.rb
116
115
  - lib/factory_girl_instruments/benchmarking.rb
117
116
  - lib/factory_girl_instruments/tracing.rb