once-ler 0.0.15 → 0.0.16

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 951a2d0bc2021d055676679c236ee9f6979c7a6a
4
+ data.tar.gz: e2eecf83edbb67e80610d15c59e5465510b2c2a8
5
+ SHA512:
6
+ metadata.gz: deec33b613d9fb1b2f140473e4c10daa37f312a0b75c9a36e87dc66d209d0ab4873447cc38cf4141f2784b10422f6347e2ef6f7630961653c1cc1b9829f15c61
7
+ data.tar.gz: fb0391864d777e3c91dd4996a86bbcd4c3f0f5d61cca71471ce67deffb43d11393b98964798faa2b009ef901b071c28121619772cbc841f109671664267b8c66
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # once-ler
2
2
 
3
+ [<img src="https://secure.travis-ci.org/instructure/once-ler.png?rvm=1.9.3" />](http://travis-ci.org/instructure/once-ler)
4
+
3
5
  once-ler supercharges your `let`s and `before`s with the performance
4
6
  of `before(:all)`. You get the performance of fixtures without all the
5
7
  headaches.
@@ -2,4 +2,6 @@ require "rspec"
2
2
  require "onceler/basic_helpers"
3
3
  require "onceler/configuration"
4
4
  require "onceler/extensions/active_record"
5
-
5
+ if defined?(DatabaseCleaner)
6
+ require "onceler/extensions/database_cleaner"
7
+ end
@@ -0,0 +1,13 @@
1
+ require "database_cleaner/active_record/transaction"
2
+
3
+ class DatabaseCleaner::ActiveRecord::Transaction
4
+ include ::Onceler::Transactions
5
+
6
+ def start
7
+ begin_transaction(connection_class.connection)
8
+ end
9
+
10
+ def clean
11
+ rollback_transaction(connection_class.connection)
12
+ end
13
+ end
@@ -80,7 +80,20 @@ module Onceler
80
80
  @__data ||= {}
81
81
  @__data[inherit] ||= begin
82
82
  @__comparison_cache = {}
83
- data = Marshal.dump([__ivars(inherit), __retvals(inherit)])
83
+ data = [__ivars(inherit), __retvals(inherit)]
84
+ begin
85
+ data = Marshal.dump(data)
86
+ rescue TypeError
87
+ data.each do |hash|
88
+ hash.each do |key, val|
89
+ begin
90
+ Marshal.dump(val)
91
+ rescue TypeError
92
+ raise TypeError.new("Unable to dump #{key} in #{self.class.metadata[:location]}: #{$!}")
93
+ end
94
+ end
95
+ end
96
+ end
84
97
  @__comparison_cache = nil
85
98
  data
86
99
  end
metadata CHANGED
@@ -1,46 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: once-ler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.15
5
- prerelease:
4
+ version: 0.0.16
6
5
  platform: ruby
7
6
  authors:
8
7
  - Jon Jensen
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2014-08-05 00:00:00.000000000 Z
11
+ date: 2014-10-23 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: activerecord
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - ">="
20
18
  - !ruby/object:Gem::Version
21
- version: '3.0'
19
+ version: '3.1'
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - ">="
28
25
  - !ruby/object:Gem::Version
29
- version: '3.0'
26
+ version: '3.1'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rspec
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - ">="
36
32
  - !ruby/object:Gem::Version
37
33
  version: '2.14'
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - ">="
44
39
  - !ruby/object:Gem::Version
45
40
  version: '2.14'
46
41
  description: once-ler supercharges your let's and before's with the performance of
@@ -52,6 +47,7 @@ extra_rdoc_files: []
52
47
  files:
53
48
  - README.md
54
49
  - lib/once-ler.rb
50
+ - lib/onceler.rb
55
51
  - lib/onceler/ambitious_helpers.rb
56
52
  - lib/onceler/basic_helpers.rb
57
53
  - lib/onceler/configuration.rb
@@ -60,35 +56,34 @@ files:
60
56
  - lib/onceler/extensions/active_record_3_2.rb
61
57
  - lib/onceler/extensions/active_record_4_0.rb
62
58
  - lib/onceler/extensions/active_record_4_1.rb
59
+ - lib/onceler/extensions/database_cleaner.rb
63
60
  - lib/onceler/recordable.rb
64
61
  - lib/onceler/recorder.rb
62
+ - lib/onceler/transactions.rb
65
63
  - lib/onceler/transactions/active_record_3.rb
66
64
  - lib/onceler/transactions/active_record_4.rb
67
- - lib/onceler/transactions.rb
68
- - lib/onceler.rb
69
65
  homepage: http://github.com/instructure/onceler
70
66
  licenses: []
67
+ metadata: {}
71
68
  post_install_message:
72
69
  rdoc_options: []
73
70
  require_paths:
74
71
  - lib
75
72
  required_ruby_version: !ruby/object:Gem::Requirement
76
- none: false
77
73
  requirements:
78
- - - ! '>='
74
+ - - ">="
79
75
  - !ruby/object:Gem::Version
80
76
  version: 1.9.3
81
77
  required_rubygems_version: !ruby/object:Gem::Requirement
82
- none: false
83
78
  requirements:
84
- - - ! '>='
79
+ - - ">="
85
80
  - !ruby/object:Gem::Version
86
81
  version: 1.3.5
87
82
  requirements: []
88
83
  rubyforge_project:
89
- rubygems_version: 1.8.23
84
+ rubygems_version: 2.2.2
90
85
  signing_key:
91
- specification_version: 3
86
+ specification_version: 4
92
87
  summary: rspec supercharger
93
88
  test_files: []
94
89
  has_rdoc: