fabricators 0.1.0 → 0.1.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: 4be64faca5c2c0d4113a421b3209ea9d9e201b1b
4
- data.tar.gz: 3a91647becc2ebe494bdcaadda4c6710acebf736
3
+ metadata.gz: ac6cf966777bb3f16621eea86a87bd9c0af77c64
4
+ data.tar.gz: 9b32910999dc3c6385e309f3dd5d2fc32ac4d03c
5
5
  SHA512:
6
- metadata.gz: 3be1d8f754cb2fca13a5e44b4556532f0c443090a38d11b180fc38e8320ed216d61c7f77be6b1d0934ef4a67a2a65b88275d78aa1a2cf0b5f52ee37c5f15642c
7
- data.tar.gz: 4e0c5a835598acdb78962f3034c617f6a1c7f7d7e556097a34a249d75fa31ad48e2794188efb1db1058e2caf180607712836f091ac757f6ab8588627b3247599
6
+ metadata.gz: e5223db0976bbe2ca6d55361b894d7c4b9b6a08d57bf894b81d08db820f5d179b3a00911195bb11b21e4d07b6fe9a3b634ddd9adaea9c19df7f174e022ab4546
7
+ data.tar.gz: 1d7825c6488dc7558dba7386b56323d056708038c35950e1ce71568257678ca03bb836fc4757c7a8c27a7270c042b5c87793e30f94ff053ccf3475898b3a29aa
@@ -1,4 +1,4 @@
1
- Copyright 2014 Museways
1
+ Copyright 2015 Museways
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
@@ -0,0 +1,149 @@
1
+ [![Gem Version](https://badge.fury.io/rb/fabricators.svg)](http://badge.fury.io/rb/fabricators) [![Code Climate](https://codeclimate.com/github/museways/fabricators/badges/gpa.svg)](https://codeclimate.com/github/museways/fabricators) [![Build Status](https://travis-ci.org/museways/fabricators.svg?branch=0.1.0)](https://travis-ci.org/museways/fabricators) [![Dependency Status](https://gemnasium.com/museways/fabricators.svg)](https://gemnasium.com/museways/fabricators)
2
+
3
+ # Fabricators
4
+
5
+ Minimalistic factory inspired in factory_girl for rails.
6
+
7
+ ## Install
8
+
9
+ Put this line in your Gemfile:
10
+ ```ruby
11
+ gem 'fabricators', group: [:development, :test]
12
+ ```
13
+
14
+ Then bundle:
15
+ ```
16
+ $ bundle
17
+ ```
18
+
19
+ ## Configuration
20
+
21
+ There is no need to configure anything, all this is done automatically for rspec and minitest:
22
+
23
+ * Loading the definitions.
24
+ * Replacing the fixtures generators.
25
+ * Including the methods inside your testing framework.
26
+ * Cleaning the database after each test.
27
+
28
+ ## Usage
29
+
30
+ ### Methods
31
+
32
+ There are three methods available:
33
+ ```ruby
34
+ attributes_for
35
+ build
36
+ create
37
+ ```
38
+
39
+ Is possible to override the defaults passing a hash:
40
+ ```ruby
41
+ build :user, name: 'other'
42
+ create :category, title: 'other'
43
+ ```
44
+
45
+ To create lists just pass the desired size as second parameter to build and create methods:
46
+ ```ruby
47
+ build :user, 2, name: 'other'
48
+ create :category, 5, title: 'other'
49
+ ```
50
+
51
+ ### Fabricators
52
+
53
+ Define them in a ruby file inside test/fabricators or spec/fabricators folders:
54
+ ```ruby
55
+ fabricator :user do
56
+ name 'example'
57
+ end
58
+ ```
59
+
60
+ ### Inheritance
61
+
62
+ Can be declare nested or separated:
63
+ ```ruby
64
+ fabricator :user do
65
+ name 'example'
66
+ fabricator :user_with_email do
67
+ email 'example@mail.com'
68
+ end
69
+ end
70
+ fabricator :user_with_age, parent: :user do
71
+ age 9
72
+ end
73
+ ```
74
+
75
+ ### Sequences
76
+
77
+ Generates an unique sequence of numbers for the attribute of the fabricator:
78
+ ```ruby
79
+ fabricator :user do
80
+ sequence(:email) { |n| "example#{n}@mail.com" }
81
+ sequence(:age)
82
+ end
83
+ ```
84
+
85
+ ### Associations
86
+
87
+ Associations are used by name:
88
+ ```ruby
89
+ fabricator :user do
90
+ posts
91
+ comments 4 # You can customize the number of records
92
+ end
93
+ fabricator :post do
94
+ user
95
+ end
96
+ fabricator :comment do
97
+ user
98
+ end
99
+ ```
100
+
101
+ ### Aliases
102
+
103
+ The aliases are important when there is the need of context:
104
+ ```ruby
105
+ fabricators :user, aliases: :author do
106
+ comments
107
+ end
108
+ fabricators :post, aliases: :comment do
109
+ title
110
+ author
111
+ end
112
+ ```
113
+
114
+ ### Dependent attributes
115
+
116
+ If you need to use some logic that depends of another attribute you can use a block or sequence:
117
+ ```ruby
118
+ fabricators :user do
119
+ name 'example'
120
+ email { "#{name}@mail.com" }
121
+ sequence(:username) { |n| "#{name}-#{n}" }
122
+ end
123
+ ```
124
+
125
+ ### Callbacks
126
+
127
+ The available callbacks are before(:build), before(:create), after(:build) and after(:create):
128
+ ```ruby
129
+ fabricator :user do
130
+ after(:build) { |u| u.name = 'sample' }
131
+ end
132
+ ```
133
+
134
+ You can declare global callbacks in your test or spec helper as well:
135
+ ```ruby
136
+ Fabricators.configure do
137
+ after(:create) do |object|
138
+ log object.errors unless object.valid?
139
+ end
140
+ end
141
+ ```
142
+
143
+ ## Credits
144
+
145
+ This gem is maintained and funded by [museways](http://museways.com).
146
+
147
+ ## License
148
+
149
+ It is free software, and may be redistributed under the terms specified in the MIT-LICENSE file.
@@ -1,5 +1,5 @@
1
1
  module Fabricators
2
2
 
3
- VERSION = '0.1.0'
3
+ VERSION = '0.1.1'
4
4
 
5
5
  end
@@ -11,7 +11,7 @@ class AliasesTest < ActiveSupport::TestCase
11
11
  end
12
12
  end
13
13
 
14
- test "aliases" do
14
+ test 'aliases' do
15
15
  assert_kind_of Fabricators::Fabricator, Fabricators.definitions.find(:user)
16
16
  assert_kind_of Fabricators::Fabricator, Fabricators.definitions.find(:owner)
17
17
  assert_kind_of Fabricators::Fabricator, Fabricators.definitions.find(:author)
@@ -23,7 +23,7 @@ class AssociationsTest < ActiveSupport::TestCase
23
23
  end
24
24
  end
25
25
 
26
- test "belongs to association" do
26
+ test 'belongs to association' do
27
27
  user = build(:post_with_built_user).user
28
28
  assert_kind_of User, user
29
29
  assert user.new_record?
@@ -33,7 +33,7 @@ class AssociationsTest < ActiveSupport::TestCase
33
33
  assert user.persisted?
34
34
  end
35
35
 
36
- test "has many association" do
36
+ test 'has many association' do
37
37
  posts = build(:user_with_built_posts).posts
38
38
  assert_equal 1, posts.size
39
39
  post = posts.first
@@ -11,13 +11,13 @@ class AttributesTest < ActiveSupport::TestCase
11
11
  end
12
12
  end
13
13
 
14
- test "block sequence" do
14
+ test 'block sequence' do
15
15
  assert_equal 'mail1@example.com', attributes_for(:user)[:email]
16
16
  assert_equal 'mail2@example.com', build(:user).email
17
17
  assert_equal 'mail3@example.com', create(:user).email
18
18
  end
19
19
 
20
- test "numeric sequence" do
20
+ test 'numeric sequence' do
21
21
  assert_equal 1, attributes_for(:user)[:age]
22
22
  assert_equal 2, build(:user).age
23
23
  assert_equal 3, create(:user).age
@@ -19,7 +19,7 @@ class CallbacksTest < ActiveSupport::TestCase
19
19
  end
20
20
  end
21
21
 
22
- test "build callbacks" do
22
+ test 'build callbacks' do
23
23
  user = build(:user)
24
24
  assert_equal 'build@example.com', user.email
25
25
  assert_equal 1, user.phone
@@ -27,7 +27,7 @@ class CallbacksTest < ActiveSupport::TestCase
27
27
  assert_equal 1, user.age
28
28
  end
29
29
 
30
- test "create callbacks" do
30
+ test 'create callbacks' do
31
31
  user = create(:user)
32
32
  assert_equal 'create@example.com', user.email
33
33
  assert_equal 2, user.phone
@@ -11,7 +11,7 @@ class CleanTest < ActiveSupport::TestCase
11
11
  Fabricators.clean
12
12
  end
13
13
 
14
- test "clean records created" do
14
+ test 'clean records' do
15
15
  assert_equal 0, User.count
16
16
  end
17
17
 
@@ -12,17 +12,17 @@ class DependentTest < ActiveSupport::TestCase
12
12
  end
13
13
  end
14
14
 
15
- test "return attributes" do
15
+ test 'return attributes' do
16
16
  assert_equal 'name-1', attributes_for(:user)[:username]
17
17
  assert_equal 'name@example.com', attributes_for(:user)[:email]
18
18
  end
19
19
 
20
- test "build instance" do
20
+ test 'build instance' do
21
21
  assert_equal 'name-1', build(:user).username
22
22
  assert_equal 'name@example.com', build(:user).email
23
23
  end
24
24
 
25
- test "create instance" do
25
+ test 'create instance' do
26
26
  assert_equal 'name-1', create(:user).username
27
27
  assert_equal 'name@example.com', create(:user).email
28
28
  end
@@ -20,7 +20,11 @@ Dummy::Application.configure do
20
20
  # config.action_dispatch.rack_cache = true
21
21
 
22
22
  # Disable Rails's static asset server (Apache or nginx will already do this).
23
- config.serve_static_assets = false
23
+ if Rails::VERSION::MAJOR == 4 && Rails::VERSION::MINOR >= 2
24
+ config.serve_static_files = false
25
+ else
26
+ config.serve_static_assets = false
27
+ end
24
28
 
25
29
  # Compress JavaScripts and CSS.
26
30
  config.assets.js_compressor = :uglifier
@@ -13,7 +13,11 @@ Dummy::Application.configure do
13
13
  config.eager_load = false
14
14
 
15
15
  # Configure static asset server for tests with Cache-Control for performance.
16
- config.serve_static_assets = true
16
+ if Rails::VERSION::MAJOR == 4 && Rails::VERSION::MINOR >= 2
17
+ config.serve_static_files = false
18
+ else
19
+ config.serve_static_assets = false
20
+ end
17
21
  config.static_cache_control = 'public, max-age=3600'
18
22
 
19
23
  # Show full error reports and disable caching.
@@ -36,4 +40,8 @@ Dummy::Application.configure do
36
40
 
37
41
  # Raises error for missing translations
38
42
  # config.action_view.raise_on_missing_translations = true
43
+
44
+ if Rails::VERSION::MAJOR == 4 && Rails::VERSION::MINOR >= 2
45
+ config.active_support.test_order = :random
46
+ end
39
47
  end
@@ -22551,3 +22551,543 @@ MergesTest: test_create_instance
22551
22551
  MergesTest: test_return_attributes
22552
22552
  ----------------------------------
22553
22553
   (0.0ms) rollback transaction
22554
+  (0.4ms) CREATE TABLE "posts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "content" varchar(255), "user_id" integer, "created_at" datetime, "updated_at" datetime) 
22555
+  (0.2ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "username" varchar(255), "name" varchar(255), "email" varchar(255), "age" integer, "phone" integer, "created_at" datetime, "updated_at" datetime)
22556
+  (0.1ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
22557
+  (0.1ms) select sqlite_version(*)
22558
+  (0.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
22559
+  (0.0ms) SELECT version FROM "schema_migrations"
22560
+  (0.1ms) INSERT INTO "schema_migrations" (version) VALUES ('20140615180954')
22561
+  (0.1ms) begin transaction
22562
+ -------------------------
22563
+ LoadTest: test_find_files
22564
+ -------------------------
22565
+  (0.1ms) rollback transaction
22566
+  (0.0ms) begin transaction
22567
+ ------------------------------------
22568
+ InheritanceTest: test_build_instance
22569
+ ------------------------------------
22570
+  (0.0ms) rollback transaction
22571
+  (0.0ms) begin transaction
22572
+ -------------------------------------
22573
+ InheritanceTest: test_create_instance
22574
+ -------------------------------------
22575
+  (0.0ms) SAVEPOINT active_record_1
22576
+ SQL (0.1ms) INSERT INTO "users" ("age", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["age", 9], ["created_at", "2014-09-17 01:30:10.916398"], ["name", "name"], ["updated_at", "2014-09-17 01:30:10.916398"]]
22577
+  (0.1ms) RELEASE SAVEPOINT active_record_1
22578
+  (0.0ms) SAVEPOINT active_record_1
22579
+ SQL (0.1ms) INSERT INTO "users" ("created_at", "email", "name", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-09-17 01:30:10.919705"], ["email", "mail@example.com"], ["name", "name"], ["updated_at", "2014-09-17 01:30:10.919705"]]
22580
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22581
+  (0.0ms) SAVEPOINT active_record_1
22582
+ SQL (0.1ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 2]]
22583
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22584
+  (0.0ms) SAVEPOINT active_record_1
22585
+ SQL (0.0ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 1]]
22586
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22587
+  (0.0ms) rollback transaction
22588
+  (0.1ms) begin transaction
22589
+ ---------------------------------------
22590
+ InheritanceTest: test_return_attributes
22591
+ ---------------------------------------
22592
+  (0.0ms) rollback transaction
22593
+  (0.0ms) begin transaction
22594
+ -----------------------------------
22595
+ AttributesTest: test_block_sequence
22596
+ -----------------------------------
22597
+  (0.0ms) SAVEPOINT active_record_1
22598
+ SQL (0.1ms) INSERT INTO "users" ("age", "created_at", "email", "updated_at") VALUES (?, ?, ?, ?) [["age", 3], ["created_at", "2014-09-17 01:30:10.924370"], ["email", "mail3@example.com"], ["updated_at", "2014-09-17 01:30:10.924370"]]
22599
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22600
+  (0.0ms) SAVEPOINT active_record_1
22601
+ SQL (0.0ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 1]]
22602
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22603
+  (0.0ms) rollback transaction
22604
+  (0.0ms) begin transaction
22605
+ -------------------------------------
22606
+ AttributesTest: test_numeric_sequence
22607
+ -------------------------------------
22608
+  (0.0ms) SAVEPOINT active_record_1
22609
+ SQL (0.0ms) INSERT INTO "users" ("age", "created_at", "email", "updated_at") VALUES (?, ?, ?, ?) [["age", 3], ["created_at", "2014-09-17 01:30:10.926632"], ["email", "mail3@example.com"], ["updated_at", "2014-09-17 01:30:10.926632"]]
22610
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22611
+  (0.0ms) SAVEPOINT active_record_1
22612
+ SQL (0.0ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 1]]
22613
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22614
+  (0.0ms) rollback transaction
22615
+  (0.0ms) begin transaction
22616
+ ------------------------------------
22617
+ GeneratorsTest: test_file_generation
22618
+ ------------------------------------
22619
+  (0.0ms) rollback transaction
22620
+  (0.0ms) begin transaction
22621
+ -----------------------------------
22622
+ CallbacksTest: test_build_callbacks
22623
+ -----------------------------------
22624
+  (0.0ms) rollback transaction
22625
+  (0.0ms) begin transaction
22626
+ ------------------------------------
22627
+ CallbacksTest: test_create_callbacks
22628
+ ------------------------------------
22629
+  (0.0ms) SAVEPOINT active_record_1
22630
+ SQL (0.1ms) INSERT INTO "users" ("age", "created_at", "email", "name", "phone", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["age", 1], ["created_at", "2014-09-17 01:30:10.933598"], ["email", "create@example.com"], ["name", "create"], ["phone", 1], ["updated_at", "2014-09-17 01:30:10.933598"]]
22631
+  (0.1ms) RELEASE SAVEPOINT active_record_1
22632
+  (0.1ms) SAVEPOINT active_record_1
22633
+ SQL (0.1ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 1]]
22634
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22635
+  (0.0ms) rollback transaction
22636
+  (0.1ms) begin transaction
22637
+ -------------------------------------
22638
+ CleanTest: test_clean_records_created
22639
+ -------------------------------------
22640
+  (0.1ms) SAVEPOINT active_record_1
22641
+ SQL (0.1ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2014-09-17 01:30:10.937761"], ["updated_at", "2014-09-17 01:30:10.937761"]]
22642
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22643
+  (0.0ms) SAVEPOINT active_record_1
22644
+ SQL (0.1ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2014-09-17 01:30:10.938899"], ["updated_at", "2014-09-17 01:30:10.938899"]]
22645
+  (0.1ms) RELEASE SAVEPOINT active_record_1
22646
+  (0.0ms) SAVEPOINT active_record_1
22647
+ SQL (0.1ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2014-09-17 01:30:10.939796"], ["updated_at", "2014-09-17 01:30:10.939796"]]
22648
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22649
+  (0.0ms) SAVEPOINT active_record_1
22650
+ SQL (0.0ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2014-09-17 01:30:10.940730"], ["updated_at", "2014-09-17 01:30:10.940730"]]
22651
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22652
+  (0.0ms) SAVEPOINT active_record_1
22653
+ SQL (0.1ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2014-09-17 01:30:10.941621"], ["updated_at", "2014-09-17 01:30:10.941621"]]
22654
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22655
+  (0.0ms) SAVEPOINT active_record_1
22656
+ SQL (0.0ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 5]]
22657
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22658
+  (0.1ms) SAVEPOINT active_record_1
22659
+ SQL (0.0ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 4]]
22660
+  (0.1ms) RELEASE SAVEPOINT active_record_1
22661
+  (0.0ms) SAVEPOINT active_record_1
22662
+ SQL (0.0ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 3]]
22663
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22664
+  (0.1ms) SAVEPOINT active_record_1
22665
+ SQL (0.0ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 2]]
22666
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22667
+  (0.1ms) SAVEPOINT active_record_1
22668
+ SQL (0.0ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 1]]
22669
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22670
+  (0.1ms) SELECT COUNT(*) FROM "users"
22671
+  (0.0ms) rollback transaction
22672
+  (0.1ms) begin transaction
22673
+ -------------------------
22674
+ AliasesTest: test_aliases
22675
+ -------------------------
22676
+  (0.0ms) rollback transaction
22677
+  (0.1ms) begin transaction
22678
+ ------------------------------------
22679
+ FabricatorsTest: test_build_instance
22680
+ ------------------------------------
22681
+  (0.1ms) rollback transaction
22682
+  (0.0ms) begin transaction
22683
+ -------------------------------------
22684
+ FabricatorsTest: test_create_instance
22685
+ -------------------------------------
22686
+  (0.1ms) SAVEPOINT active_record_1
22687
+ SQL (0.1ms) INSERT INTO "users" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2014-09-17 01:30:10.950084"], ["name", "name"], ["updated_at", "2014-09-17 01:30:10.950084"]]
22688
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22689
+  (0.1ms) SAVEPOINT active_record_1
22690
+ SQL (0.0ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 1]]
22691
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22692
+  (0.1ms) rollback transaction
22693
+  (0.0ms) begin transaction
22694
+ ---------------------------------------
22695
+ FabricatorsTest: test_return_attributes
22696
+ ---------------------------------------
22697
+  (0.0ms) rollback transaction
22698
+  (0.0ms) begin transaction
22699
+ ----------------------------------
22700
+ DependentTest: test_build_instance
22701
+ ----------------------------------
22702
+  (0.0ms) rollback transaction
22703
+  (0.0ms) begin transaction
22704
+ -----------------------------------
22705
+ DependentTest: test_create_instance
22706
+ -----------------------------------
22707
+  (0.0ms) SAVEPOINT active_record_1
22708
+ SQL (0.1ms) INSERT INTO "users" ("created_at", "email", "name", "updated_at", "username") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-09-17 01:30:10.954370"], ["email", "name@example.com"], ["name", "name"], ["updated_at", "2014-09-17 01:30:10.954370"], ["username", "name-1"]]
22709
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22710
+  (0.0ms) SAVEPOINT active_record_1
22711
+ SQL (0.1ms) INSERT INTO "users" ("created_at", "email", "name", "updated_at", "username") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-09-17 01:30:10.955504"], ["email", "name@example.com"], ["name", "name"], ["updated_at", "2014-09-17 01:30:10.955504"], ["username", "name-2"]]
22712
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22713
+  (0.1ms) SAVEPOINT active_record_1
22714
+ SQL (0.0ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 2]]
22715
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22716
+  (0.0ms) SAVEPOINT active_record_1
22717
+ SQL (0.0ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 1]]
22718
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22719
+  (0.0ms) rollback transaction
22720
+  (0.0ms) begin transaction
22721
+ -------------------------------------
22722
+ DependentTest: test_return_attributes
22723
+ -------------------------------------
22724
+  (0.0ms) rollback transaction
22725
+  (0.0ms) begin transaction
22726
+ --------------------------
22727
+ ListsTest: test_build_list
22728
+ --------------------------
22729
+  (0.0ms) rollback transaction
22730
+  (0.0ms) begin transaction
22731
+ ---------------------------
22732
+ ListsTest: test_create_list
22733
+ ---------------------------
22734
+  (0.0ms) SAVEPOINT active_record_1
22735
+ SQL (0.0ms) INSERT INTO "users" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2014-09-17 01:30:10.959893"], ["name", "name"], ["updated_at", "2014-09-17 01:30:10.959893"]]
22736
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22737
+  (0.0ms) SAVEPOINT active_record_1
22738
+ SQL (0.0ms) INSERT INTO "users" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2014-09-17 01:30:10.960883"], ["name", "name"], ["updated_at", "2014-09-17 01:30:10.960883"]]
22739
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22740
+  (0.0ms) SAVEPOINT active_record_1
22741
+ SQL (0.0ms) INSERT INTO "users" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2014-09-17 01:30:10.961772"], ["name", "name"], ["updated_at", "2014-09-17 01:30:10.961772"]]
22742
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22743
+  (0.0ms) SAVEPOINT active_record_1
22744
+ SQL (0.1ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 3]]
22745
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22746
+  (0.0ms) SAVEPOINT active_record_1
22747
+ SQL (0.0ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 2]]
22748
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22749
+  (0.0ms) SAVEPOINT active_record_1
22750
+ SQL (0.0ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 1]]
22751
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22752
+  (0.0ms) rollback transaction
22753
+  (0.0ms) begin transaction
22754
+ -------------------------------
22755
+ MergesTest: test_build_instance
22756
+ -------------------------------
22757
+  (0.0ms) rollback transaction
22758
+  (0.0ms) begin transaction
22759
+ --------------------------------
22760
+ MergesTest: test_create_instance
22761
+ --------------------------------
22762
+  (0.0ms) SAVEPOINT active_record_1
22763
+ SQL (0.0ms) INSERT INTO "users" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2014-09-17 01:30:10.966049"], ["name", "other"], ["updated_at", "2014-09-17 01:30:10.966049"]]
22764
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22765
+  (0.0ms) SAVEPOINT active_record_1
22766
+ SQL (0.0ms) INSERT INTO "users" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2014-09-17 01:30:10.967010"], ["name", "other"], ["updated_at", "2014-09-17 01:30:10.967010"]]
22767
+  (0.1ms) RELEASE SAVEPOINT active_record_1
22768
+  (0.0ms) SAVEPOINT active_record_1
22769
+ SQL (0.0ms) INSERT INTO "users" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2014-09-17 01:30:10.967967"], ["name", "other"], ["updated_at", "2014-09-17 01:30:10.967967"]]
22770
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22771
+  (0.0ms) SAVEPOINT active_record_1
22772
+ SQL (0.1ms) INSERT INTO "users" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2014-09-17 01:30:10.968894"], ["name", "other"], ["updated_at", "2014-09-17 01:30:10.968894"]]
22773
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22774
+  (0.0ms) SAVEPOINT active_record_1
22775
+ SQL (0.0ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 4]]
22776
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22777
+  (0.0ms) SAVEPOINT active_record_1
22778
+ SQL (0.0ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 3]]
22779
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22780
+  (0.0ms) SAVEPOINT active_record_1
22781
+ SQL (0.0ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 2]]
22782
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22783
+  (0.0ms) SAVEPOINT active_record_1
22784
+ SQL (0.0ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 1]]
22785
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22786
+  (0.1ms) rollback transaction
22787
+  (0.0ms) begin transaction
22788
+ ----------------------------------
22789
+ MergesTest: test_return_attributes
22790
+ ----------------------------------
22791
+  (0.0ms) rollback transaction
22792
+  (0.0ms) begin transaction
22793
+ ---------------------------------------------
22794
+ AssociationsTest: test_belongs_to_association
22795
+ ---------------------------------------------
22796
+  (0.1ms) SAVEPOINT active_record_1
22797
+ SQL (0.1ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2014-09-17 01:30:10.982822"], ["updated_at", "2014-09-17 01:30:10.982822"]]
22798
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22799
+  (0.0ms) SAVEPOINT active_record_1
22800
+ SQL (0.0ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 1]]
22801
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22802
+  (0.0ms) rollback transaction
22803
+  (0.0ms) begin transaction
22804
+ -------------------------------------------
22805
+ AssociationsTest: test_has_many_association
22806
+ -------------------------------------------
22807
+  (0.1ms) SAVEPOINT active_record_1
22808
+ SQL (0.1ms) INSERT INTO "posts" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2014-09-17 01:30:10.994993"], ["updated_at", "2014-09-17 01:30:10.994993"]]
22809
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22810
+  (0.0ms) SAVEPOINT active_record_1
22811
+ SQL (0.0ms) INSERT INTO "posts" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2014-09-17 01:30:10.996227"], ["updated_at", "2014-09-17 01:30:10.996227"]]
22812
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22813
+  (0.1ms) SAVEPOINT active_record_1
22814
+ SQL (0.1ms) DELETE FROM "posts" WHERE "posts"."id" = ? [["id", 2]]
22815
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22816
+  (0.0ms) SAVEPOINT active_record_1
22817
+ SQL (0.0ms) DELETE FROM "posts" WHERE "posts"."id" = ? [["id", 1]]
22818
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22819
+  (0.0ms) rollback transaction
22820
+  (0.4ms) CREATE TABLE "posts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "content" varchar, "user_id" integer, "created_at" datetime, "updated_at" datetime) 
22821
+  (0.3ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "username" varchar, "name" varchar, "email" varchar, "age" integer, "phone" integer, "created_at" datetime, "updated_at" datetime)
22822
+  (0.1ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
22823
+  (0.1ms) select sqlite_version(*)
22824
+  (0.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
22825
+  (0.1ms) SELECT version FROM "schema_migrations"
22826
+  (0.1ms) INSERT INTO "schema_migrations" (version) VALUES ('20140615180954')
22827
+  (0.1ms) INSERT INTO "schema_migrations" (version) VALUES ('20140613221835')
22828
+  (0.6ms) CREATE TABLE "posts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "content" varchar, "user_id" integer, "created_at" datetime, "updated_at" datetime) 
22829
+  (0.4ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "username" varchar, "name" varchar, "email" varchar, "age" integer, "phone" integer, "created_at" datetime, "updated_at" datetime)
22830
+  (0.2ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
22831
+  (0.1ms) select sqlite_version(*)
22832
+  (0.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
22833
+  (0.1ms) SELECT version FROM "schema_migrations"
22834
+  (0.1ms) INSERT INTO "schema_migrations" (version) VALUES ('20140615180954')
22835
+  (0.1ms) begin transaction
22836
+ -------------------------------
22837
+ MergesTest: test_build_instance
22838
+ -------------------------------
22839
+  (0.1ms) rollback transaction
22840
+  (0.0ms) begin transaction
22841
+ ----------------------------------
22842
+ MergesTest: test_return_attributes
22843
+ ----------------------------------
22844
+  (0.0ms) rollback transaction
22845
+  (0.0ms) begin transaction
22846
+ --------------------------------
22847
+ MergesTest: test_create_instance
22848
+ --------------------------------
22849
+  (0.0ms) SAVEPOINT active_record_1
22850
+ SQL (0.1ms) INSERT INTO "users" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "other"], ["created_at", "2015-02-15 23:27:45.532028"], ["updated_at", "2015-02-15 23:27:45.532028"]]
22851
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22852
+  (0.0ms) SAVEPOINT active_record_1
22853
+ SQL (0.1ms) INSERT INTO "users" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "other"], ["created_at", "2015-02-15 23:27:45.535698"], ["updated_at", "2015-02-15 23:27:45.535698"]]
22854
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22855
+  (0.0ms) SAVEPOINT active_record_1
22856
+ SQL (0.0ms) INSERT INTO "users" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "other"], ["created_at", "2015-02-15 23:27:45.537183"], ["updated_at", "2015-02-15 23:27:45.537183"]]
22857
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22858
+  (0.0ms) SAVEPOINT active_record_1
22859
+ SQL (0.0ms) INSERT INTO "users" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "other"], ["created_at", "2015-02-15 23:27:45.538434"], ["updated_at", "2015-02-15 23:27:45.538434"]]
22860
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22861
+  (0.0ms) SAVEPOINT active_record_1
22862
+ SQL (0.1ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 4]]
22863
+  (0.1ms) RELEASE SAVEPOINT active_record_1
22864
+  (0.0ms) SAVEPOINT active_record_1
22865
+ SQL (0.0ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 3]]
22866
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22867
+  (0.0ms) SAVEPOINT active_record_1
22868
+ SQL (0.0ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 2]]
22869
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22870
+  (0.0ms) SAVEPOINT active_record_1
22871
+ SQL (0.0ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 1]]
22872
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22873
+  (0.0ms) rollback transaction
22874
+  (0.0ms) begin transaction
22875
+ -----------------------------------
22876
+ CallbacksTest: test_build_callbacks
22877
+ -----------------------------------
22878
+  (0.0ms) rollback transaction
22879
+  (0.0ms) begin transaction
22880
+ ------------------------------------
22881
+ CallbacksTest: test_create_callbacks
22882
+ ------------------------------------
22883
+  (0.1ms) SAVEPOINT active_record_1
22884
+ SQL (0.1ms) INSERT INTO "users" ("email", "name", "phone", "age", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["email", "create@example.com"], ["name", "create"], ["phone", 1], ["age", 1], ["created_at", "2015-02-15 23:27:45.545454"], ["updated_at", "2015-02-15 23:27:45.545454"]]
22885
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22886
+  (0.0ms) SAVEPOINT active_record_1
22887
+ SQL (0.1ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 1]]
22888
+  (0.1ms) RELEASE SAVEPOINT active_record_1
22889
+  (0.0ms) rollback transaction
22890
+  (0.0ms) begin transaction
22891
+ ---------------------------------------------
22892
+ AssociationsTest: test_belongs_to_association
22893
+ ---------------------------------------------
22894
+  (0.1ms) SAVEPOINT active_record_1
22895
+ SQL (0.1ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-02-15 23:27:45.563673"], ["updated_at", "2015-02-15 23:27:45.563673"]]
22896
+  (0.1ms) RELEASE SAVEPOINT active_record_1
22897
+  (0.1ms) SAVEPOINT active_record_1
22898
+ SQL (0.1ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 1]]
22899
+  (0.1ms) RELEASE SAVEPOINT active_record_1
22900
+  (0.1ms) rollback transaction
22901
+  (0.1ms) begin transaction
22902
+ -------------------------------------------
22903
+ AssociationsTest: test_has_many_association
22904
+ -------------------------------------------
22905
+  (0.1ms) SAVEPOINT active_record_1
22906
+ SQL (0.1ms) INSERT INTO "posts" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-02-15 23:27:45.576171"], ["updated_at", "2015-02-15 23:27:45.576171"]]
22907
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22908
+  (0.0ms) SAVEPOINT active_record_1
22909
+ SQL (0.1ms) INSERT INTO "posts" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-02-15 23:27:45.577580"], ["updated_at", "2015-02-15 23:27:45.577580"]]
22910
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22911
+  (0.0ms) SAVEPOINT active_record_1
22912
+ SQL (0.1ms) DELETE FROM "posts" WHERE "posts"."id" = ? [["id", 2]]
22913
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22914
+  (0.0ms) SAVEPOINT active_record_1
22915
+ SQL (0.0ms) DELETE FROM "posts" WHERE "posts"."id" = ? [["id", 1]]
22916
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22917
+  (0.0ms) rollback transaction
22918
+  (0.0ms) begin transaction
22919
+ --------------------------
22920
+ ListsTest: test_build_list
22921
+ --------------------------
22922
+  (0.1ms) rollback transaction
22923
+  (0.1ms) begin transaction
22924
+ ---------------------------
22925
+ ListsTest: test_create_list
22926
+ ---------------------------
22927
+  (0.0ms) SAVEPOINT active_record_1
22928
+ SQL (0.1ms) INSERT INTO "users" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "name"], ["created_at", "2015-02-15 23:27:45.583403"], ["updated_at", "2015-02-15 23:27:45.583403"]]
22929
+  (0.1ms) RELEASE SAVEPOINT active_record_1
22930
+  (0.0ms) SAVEPOINT active_record_1
22931
+ SQL (0.1ms) INSERT INTO "users" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "name"], ["created_at", "2015-02-15 23:27:45.585197"], ["updated_at", "2015-02-15 23:27:45.585197"]]
22932
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22933
+  (0.0ms) SAVEPOINT active_record_1
22934
+ SQL (0.0ms) INSERT INTO "users" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "name"], ["created_at", "2015-02-15 23:27:45.586688"], ["updated_at", "2015-02-15 23:27:45.586688"]]
22935
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22936
+  (0.0ms) SAVEPOINT active_record_1
22937
+ SQL (0.0ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 3]]
22938
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22939
+  (0.0ms) SAVEPOINT active_record_1
22940
+ SQL (0.0ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 2]]
22941
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22942
+  (0.0ms) SAVEPOINT active_record_1
22943
+ SQL (0.0ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 1]]
22944
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22945
+  (0.0ms) rollback transaction
22946
+  (0.0ms) begin transaction
22947
+ ------------------------------------
22948
+ FabricatorsTest: test_build_instance
22949
+ ------------------------------------
22950
+  (0.0ms) rollback transaction
22951
+  (0.0ms) begin transaction
22952
+ -------------------------------------
22953
+ FabricatorsTest: test_create_instance
22954
+ -------------------------------------
22955
+  (0.0ms) SAVEPOINT active_record_1
22956
+ SQL (0.1ms) INSERT INTO "users" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "name"], ["created_at", "2015-02-15 23:27:45.592028"], ["updated_at", "2015-02-15 23:27:45.592028"]]
22957
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22958
+  (0.0ms) SAVEPOINT active_record_1
22959
+ SQL (0.0ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 1]]
22960
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22961
+  (0.0ms) rollback transaction
22962
+  (0.0ms) begin transaction
22963
+ ---------------------------------------
22964
+ FabricatorsTest: test_return_attributes
22965
+ ---------------------------------------
22966
+  (0.0ms) rollback transaction
22967
+  (0.0ms) begin transaction
22968
+ -------------------------
22969
+ LoadTest: test_find_files
22970
+ -------------------------
22971
+  (0.0ms) rollback transaction
22972
+  (0.1ms) begin transaction
22973
+ ------------------------------------
22974
+ InheritanceTest: test_build_instance
22975
+ ------------------------------------
22976
+  (0.0ms) rollback transaction
22977
+  (0.0ms) begin transaction
22978
+ -------------------------------------
22979
+ InheritanceTest: test_create_instance
22980
+ -------------------------------------
22981
+  (0.0ms) SAVEPOINT active_record_1
22982
+ SQL (0.1ms) INSERT INTO "users" ("name", "age", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "name"], ["age", 9], ["created_at", "2015-02-15 23:27:45.599234"], ["updated_at", "2015-02-15 23:27:45.599234"]]
22983
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22984
+  (0.0ms) SAVEPOINT active_record_1
22985
+ SQL (0.1ms) INSERT INTO "users" ("name", "email", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "name"], ["email", "mail@example.com"], ["created_at", "2015-02-15 23:27:45.600968"], ["updated_at", "2015-02-15 23:27:45.600968"]]
22986
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22987
+  (0.0ms) SAVEPOINT active_record_1
22988
+ SQL (0.0ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 2]]
22989
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22990
+  (0.1ms) SAVEPOINT active_record_1
22991
+ SQL (0.0ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 1]]
22992
+  (0.0ms) RELEASE SAVEPOINT active_record_1
22993
+  (0.1ms) rollback transaction
22994
+  (0.0ms) begin transaction
22995
+ ---------------------------------------
22996
+ InheritanceTest: test_return_attributes
22997
+ ---------------------------------------
22998
+  (0.0ms) rollback transaction
22999
+  (0.1ms) begin transaction
23000
+ ----------------------------------
23001
+ DependentTest: test_build_instance
23002
+ ----------------------------------
23003
+  (0.0ms) rollback transaction
23004
+  (0.0ms) begin transaction
23005
+ -------------------------------------
23006
+ DependentTest: test_return_attributes
23007
+ -------------------------------------
23008
+  (0.0ms) rollback transaction
23009
+  (0.0ms) begin transaction
23010
+ -----------------------------------
23011
+ DependentTest: test_create_instance
23012
+ -----------------------------------
23013
+  (0.0ms) SAVEPOINT active_record_1
23014
+ SQL (0.1ms) INSERT INTO "users" ("name", "email", "username", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["name", "name"], ["email", "name@example.com"], ["username", "name-1"], ["created_at", "2015-02-15 23:27:45.607537"], ["updated_at", "2015-02-15 23:27:45.607537"]]
23015
+  (0.0ms) RELEASE SAVEPOINT active_record_1
23016
+  (0.0ms) SAVEPOINT active_record_1
23017
+ SQL (0.1ms) INSERT INTO "users" ("name", "email", "username", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["name", "name"], ["email", "name@example.com"], ["username", "name-2"], ["created_at", "2015-02-15 23:27:45.609223"], ["updated_at", "2015-02-15 23:27:45.609223"]]
23018
+  (0.1ms) RELEASE SAVEPOINT active_record_1
23019
+  (0.0ms) SAVEPOINT active_record_1
23020
+ SQL (0.0ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 2]]
23021
+  (0.0ms) RELEASE SAVEPOINT active_record_1
23022
+  (0.0ms) SAVEPOINT active_record_1
23023
+ SQL (0.0ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 1]]
23024
+  (0.0ms) RELEASE SAVEPOINT active_record_1
23025
+  (0.0ms) rollback transaction
23026
+  (0.0ms) begin transaction
23027
+ -------------------------
23028
+ AliasesTest: test_aliases
23029
+ -------------------------
23030
+  (0.0ms) rollback transaction
23031
+  (0.1ms) begin transaction
23032
+ ------------------------------------
23033
+ GeneratorsTest: test_file_generation
23034
+ ------------------------------------
23035
+  (0.1ms) rollback transaction
23036
+  (0.1ms) begin transaction
23037
+ -----------------------------
23038
+ CleanTest: test_clean_records
23039
+ -----------------------------
23040
+  (0.0ms) SAVEPOINT active_record_1
23041
+ SQL (0.1ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-02-15 23:27:45.616734"], ["updated_at", "2015-02-15 23:27:45.616734"]]
23042
+  (0.0ms) RELEASE SAVEPOINT active_record_1
23043
+  (0.1ms) SAVEPOINT active_record_1
23044
+ SQL (0.1ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-02-15 23:27:45.618257"], ["updated_at", "2015-02-15 23:27:45.618257"]]
23045
+  (0.1ms) RELEASE SAVEPOINT active_record_1
23046
+  (0.0ms) SAVEPOINT active_record_1
23047
+ SQL (0.0ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-02-15 23:27:45.619570"], ["updated_at", "2015-02-15 23:27:45.619570"]]
23048
+  (0.1ms) RELEASE SAVEPOINT active_record_1
23049
+  (0.0ms) SAVEPOINT active_record_1
23050
+ SQL (0.1ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-02-15 23:27:45.620767"], ["updated_at", "2015-02-15 23:27:45.620767"]]
23051
+  (0.0ms) RELEASE SAVEPOINT active_record_1
23052
+  (0.0ms) SAVEPOINT active_record_1
23053
+ SQL (0.0ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-02-15 23:27:45.621917"], ["updated_at", "2015-02-15 23:27:45.621917"]]
23054
+  (0.0ms) RELEASE SAVEPOINT active_record_1
23055
+  (0.0ms) SAVEPOINT active_record_1
23056
+ SQL (0.0ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 5]]
23057
+  (0.0ms) RELEASE SAVEPOINT active_record_1
23058
+  (0.0ms) SAVEPOINT active_record_1
23059
+ SQL (0.0ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 4]]
23060
+  (0.0ms) RELEASE SAVEPOINT active_record_1
23061
+  (0.0ms) SAVEPOINT active_record_1
23062
+ SQL (0.0ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 3]]
23063
+  (0.1ms) RELEASE SAVEPOINT active_record_1
23064
+  (0.0ms) SAVEPOINT active_record_1
23065
+ SQL (0.0ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 2]]
23066
+  (0.1ms) RELEASE SAVEPOINT active_record_1
23067
+  (0.0ms) SAVEPOINT active_record_1
23068
+ SQL (0.0ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 1]]
23069
+  (0.0ms) RELEASE SAVEPOINT active_record_1
23070
+  (0.1ms) SELECT COUNT(*) FROM "users"
23071
+  (0.0ms) rollback transaction
23072
+  (0.2ms) begin transaction
23073
+ -------------------------------------
23074
+ AttributesTest: test_numeric_sequence
23075
+ -------------------------------------
23076
+  (0.1ms) SAVEPOINT active_record_1
23077
+ SQL (0.1ms) INSERT INTO "users" ("email", "age", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["email", "mail3@example.com"], ["age", 3], ["created_at", "2015-02-15 23:27:45.637074"], ["updated_at", "2015-02-15 23:27:45.637074"]]
23078
+  (0.0ms) RELEASE SAVEPOINT active_record_1
23079
+  (0.0ms) SAVEPOINT active_record_1
23080
+ SQL (0.0ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 1]]
23081
+  (0.0ms) RELEASE SAVEPOINT active_record_1
23082
+  (0.0ms) rollback transaction
23083
+  (0.0ms) begin transaction
23084
+ -----------------------------------
23085
+ AttributesTest: test_block_sequence
23086
+ -----------------------------------
23087
+  (0.0ms) SAVEPOINT active_record_1
23088
+ SQL (0.0ms) INSERT INTO "users" ("email", "age", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["email", "mail3@example.com"], ["age", 3], ["created_at", "2015-02-15 23:27:45.640129"], ["updated_at", "2015-02-15 23:27:45.640129"]]
23089
+  (0.0ms) RELEASE SAVEPOINT active_record_1
23090
+  (0.0ms) SAVEPOINT active_record_1
23091
+ SQL (0.0ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 1]]
23092
+  (0.0ms) RELEASE SAVEPOINT active_record_1
23093
+  (0.1ms) rollback transaction
@@ -10,20 +10,20 @@ class FabricatorsTest < ActiveSupport::TestCase
10
10
  end
11
11
  end
12
12
 
13
- test "return attributes" do
13
+ test 'return attributes' do
14
14
  hash = attributes_for(:user)
15
15
  assert_kind_of Hash, hash
16
16
  assert_equal 'name', hash[:name]
17
17
  end
18
18
 
19
- test "build instance" do
19
+ test 'build instance' do
20
20
  record = build(:user)
21
21
  assert_kind_of User, record
22
22
  assert record.new_record?
23
23
  assert_equal 'name', record.name
24
24
  end
25
25
 
26
- test "create instance" do
26
+ test 'create instance' do
27
27
  record = create(:user)
28
28
  assert_kind_of User, record
29
29
  assert record.persisted?
@@ -6,7 +6,7 @@ class GeneratorsTest < Rails::Generators::TestCase
6
6
  tests Fabricators::Generators::ModelGenerator
7
7
  destination File.expand_path('../tmp', File.dirname(__FILE__))
8
8
 
9
- test "file generation" do
9
+ test 'file generation' do
10
10
  run_generator %w(person)
11
11
  end
12
12
 
@@ -16,7 +16,7 @@ class InheritanceTest < ActiveSupport::TestCase
16
16
  end
17
17
  end
18
18
 
19
- test "return attributes" do
19
+ test 'return attributes' do
20
20
  user_with_age = attributes_for(:user_with_age)
21
21
  assert_equal 'name', user_with_age[:name]
22
22
  assert_equal 9, user_with_age[:age]
@@ -26,7 +26,7 @@ class InheritanceTest < ActiveSupport::TestCase
26
26
  assert_equal 'mail@example.com', user_with_email[:email]
27
27
  end
28
28
 
29
- test "build instance" do
29
+ test 'build instance' do
30
30
  user_with_age = build(:user_with_age)
31
31
  assert_equal 'name', user_with_age.name
32
32
  assert_equal 9, user_with_age.age
@@ -36,7 +36,7 @@ class InheritanceTest < ActiveSupport::TestCase
36
36
  assert_equal 'mail@example.com', user_with_email.email
37
37
  end
38
38
 
39
- test "create instance" do
39
+ test 'create instance' do
40
40
  user_with_age = create(:user_with_age)
41
41
  assert_equal 'name', user_with_age.name
42
42
  assert_equal 9, user_with_age.age
@@ -10,7 +10,7 @@ class ListsTest < ActiveSupport::TestCase
10
10
  end
11
11
  end
12
12
 
13
- test "build list" do
13
+ test 'build list' do
14
14
  list = build(:user, 3)
15
15
  assert_equal 3, list.size
16
16
  list.each do |user|
@@ -20,7 +20,7 @@ class ListsTest < ActiveSupport::TestCase
20
20
  end
21
21
  end
22
22
 
23
- test "create list" do
23
+ test 'create list' do
24
24
  list = create(:user, 3)
25
25
  assert_equal 3, list.size
26
26
  list.each do |user|
@@ -6,7 +6,7 @@ class LoadTest < ActiveSupport::TestCase
6
6
  Fabricators.load
7
7
  end
8
8
 
9
- test "find files" do
9
+ test 'find files' do
10
10
  assert build(:user)
11
11
  end
12
12
 
@@ -10,18 +10,18 @@ class MergesTest < ActiveSupport::TestCase
10
10
  end
11
11
  end
12
12
 
13
- test "return attributes" do
13
+ test 'return attributes' do
14
14
  assert_equal 'other', attributes_for(:user, name: 'other')[:name]
15
15
  end
16
16
 
17
- test "build instance" do
17
+ test 'build instance' do
18
18
  assert_equal 'other', build(:user, name: 'other').name
19
19
  build(:user, 3, name: 'other').each do |user|
20
20
  assert_equal 'other', user.name
21
21
  end
22
22
  end
23
23
 
24
- test "create instance" do
24
+ test 'create instance' do
25
25
  assert_equal 'other', create(:user, name: 'other').name
26
26
  create(:user, 3, name: 'other').each do |user|
27
27
  assert_equal 'other', user.name
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fabricators
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Museways
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-26 00:00:00.000000000 Z
11
+ date: 2015-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -16,8 +16,8 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 3.1.0
20
- - - "<"
19
+ version: 4.0.0
20
+ - - "<="
21
21
  - !ruby/object:Gem::Version
22
22
  version: 4.2.0
23
23
  type: :runtime
@@ -26,8 +26,8 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: 3.1.0
30
- - - "<"
29
+ version: 4.0.0
30
+ - - "<="
31
31
  - !ruby/object:Gem::Version
32
32
  version: 4.2.0
33
33
  - !ruby/object:Gem::Dependency
@@ -52,7 +52,7 @@ extensions: []
52
52
  extra_rdoc_files: []
53
53
  files:
54
54
  - MIT-LICENSE
55
- - README.rdoc
55
+ - README.md
56
56
  - Rakefile
57
57
  - lib/fabricators.rb
58
58
  - lib/fabricators/callbacks.rb
@@ -142,7 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
142
142
  version: '0'
143
143
  requirements: []
144
144
  rubyforge_project:
145
- rubygems_version: 2.2.2
145
+ rubygems_version: 2.4.5
146
146
  signing_key:
147
147
  specification_version: 4
148
148
  summary: Fabricators for Rails
@@ -1,127 +0,0 @@
1
- === NOTE: Important changes in version 0.1.0, read below.
2
-
3
- ---
4
-
5
- {<img src="https://badge.fury.io/rb/fabricators.png" alt="Gem Version" />}[http://badge.fury.io/rb/fabricators] {<img src="https://codeclimate.com/github/museways/fabricators.png" />}[https://codeclimate.com/github/museways/fabricators] {<img src="https://travis-ci.org/museways/fabricators.png?branch=master" alt="Build Status" />}[https://travis-ci.org/museways/fabricators]
6
-
7
- = Fabricators
8
-
9
- Minimalistic factory inspired in factory_girl for rails.
10
-
11
- = Install
12
-
13
- Put this line in your Gemfile:
14
- gem 'fabricators', group: [:development, :test]
15
-
16
- Then bundle:
17
- $ bundle
18
-
19
- = Configuration
20
-
21
- There is no need to configure anything, all this is done automatically for rspec and minitest:
22
-
23
- - Loading the definitions.
24
- - Replacing the fixtures generators.
25
- - Including the methods inside your testing framework.
26
- - Cleaning the database after each test.
27
-
28
- = Usage
29
-
30
- == Methods
31
-
32
- There are three methods available:
33
- attributes_for
34
- build
35
- create
36
-
37
- Is possible to override the defaults passing a hash:
38
- build :user, name: 'other'
39
- create :category, title: 'other'
40
-
41
- To create lists just pass the desired size as second parameter to build and create methods:
42
- build :user, 2, name: 'other'
43
- create :category, 5, title: 'other'
44
-
45
- == Fabricators
46
-
47
- Define them in a ruby file inside test/fabricators or spec/fabricators folders:
48
- fabricator :user do
49
- name 'example'
50
- end
51
-
52
- == Inheritance
53
-
54
- Can be declare nested or separated:
55
- fabricator :user do
56
- name 'example'
57
- fabricator :user_with_email do
58
- email 'example@mail.com'
59
- end
60
- end
61
- fabricator :user_with_age, parent: :user do
62
- age 9
63
- end
64
-
65
- == Sequences
66
-
67
- Generates an unique sequence of numbers for the attribute of the fabricator:
68
- fabricator :user do
69
- sequence(:email) { |n| "example#{n}@mail.com" }
70
- sequence(:age)
71
- end
72
-
73
- == Associations
74
-
75
- Associations are used by name:
76
- fabricator :user do
77
- posts
78
- comments 4 # You can customize the number of records
79
- end
80
- fabricator :post do
81
- user
82
- end
83
- fabricator :comment do
84
- user
85
- end
86
-
87
- == Aliases
88
-
89
- The aliases are important when there is the need of context:
90
- fabricators :user, aliases: :author do
91
- comments
92
- end
93
- fabricators :post, aliases: :comment do
94
- title
95
- author
96
- end
97
-
98
- == Dependent attributes
99
-
100
- If you need to use some logic that depends of another attribute you can use a block or sequence:
101
- fabricators :user do
102
- name 'example'
103
- email { "#{name}@mail.com" }
104
- sequence(:username) { |n| "#{name}-#{n}" }
105
- end
106
-
107
- == Callbacks
108
-
109
- The available callbacks are before(:build), before(:create), after(:build) and after(:create):
110
- fabricator :user do
111
- after(:build) { |u| u.name = 'sample' }
112
- end
113
-
114
- You can declare global callbacks in your test or spec helper as well:
115
- Fabricators.configure do
116
- after(:create) do |object|
117
- log object.errors unless object.valid?
118
- end
119
- end
120
-
121
- = Credits
122
-
123
- This gem is maintained and funded by museways[http://museways.com].
124
-
125
- = License
126
-
127
- It is free software, and may be redistributed under the terms specified in the MIT-LICENSE file.