rspec-activerecord 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/LICENCE +22 -0
- data/README.md +34 -0
- data/lib/rspec-activerecord.rb +1 -0
- data/lib/rspec/active_record.rb +41 -0
- metadata +126 -0
data/LICENCE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
(The MIT License)
|
2
|
+
|
3
|
+
Copyright (c) 2006 David Chelimsky, The RSpec Development Team
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
19
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
20
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
21
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
22
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
Support for using ActiveRecord within RSpec as a standalone module (*without*
|
2
|
+
Rails).
|
3
|
+
|
4
|
+
# Usage
|
5
|
+
|
6
|
+
Put this somewhere in your `spec_helper.rb` (or similar):
|
7
|
+
|
8
|
+
require 'rspec-activerecord'
|
9
|
+
|
10
|
+
Then use the `fixtures` method and your helpers as per normal.
|
11
|
+
|
12
|
+
|
13
|
+
# Configuration
|
14
|
+
|
15
|
+
RSpec.configure do |c|
|
16
|
+
c.use_transactional_fixtures = true / false
|
17
|
+
c.use_instantiated_fixtures = true / false
|
18
|
+
c.fixture_path = "some/path"
|
19
|
+
c.global_fixtures = [:foo, :bar]
|
20
|
+
end
|
21
|
+
|
22
|
+
|
23
|
+
# Enhancements
|
24
|
+
|
25
|
+
Make the changes you want, then [Submit a pull request on
|
26
|
+
Github](https://github.com/mpalmer/rspec-activerecord/pulls). I don't
|
27
|
+
accept bug reports; if something breaks, you get to keep both pieces.
|
28
|
+
|
29
|
+
|
30
|
+
# Licence
|
31
|
+
|
32
|
+
Since this gem is essentially nothing more than big chunks of the
|
33
|
+
`rspec-rails` gem, this code is licenced under the same terms as that gem,
|
34
|
+
as described in `LICENCE`.
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'rspec/active_record'
|
@@ -0,0 +1,41 @@
|
|
1
|
+
require 'active_record/fixtures'
|
2
|
+
require 'rspec/active_record/adapters'
|
3
|
+
|
4
|
+
module RSpec
|
5
|
+
module ActiveRecord
|
6
|
+
module FixtureSupport
|
7
|
+
extend ::ActiveSupport::Concern
|
8
|
+
include ::RSpec::ActiveRecord::SetupAndTeardownAdapter
|
9
|
+
include ::ActiveRecord::TestFixtures
|
10
|
+
|
11
|
+
included do
|
12
|
+
%w{fixture_path use_transactional_fixtures
|
13
|
+
use_instantiated_fixtures pre_loaded_fixtures}.each do |param|
|
14
|
+
self.send("#{param}=".to_sym, RSpec.configuration.send(param.to_sym))
|
15
|
+
end
|
16
|
+
|
17
|
+
%w{fixture_table_names fixture_class_names}.each do |param|
|
18
|
+
if RSpec.configuration.send(param.to_sym)
|
19
|
+
self.send("#{param}=".to_sym, RSpec.configuration.send(param.to_sym))
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
if RSpec.configuration.global_fixtures
|
24
|
+
fixtures RSpec.configuration.global_fixtures
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
RSpec.configure do |c|
|
30
|
+
c.include RSpec::ActiveRecord::FixtureSupport
|
31
|
+
|
32
|
+
c.add_setting :use_transactional_fixtures, :alias_with => :use_transactional_examples
|
33
|
+
c.add_setting :use_instantiated_fixtures
|
34
|
+
c.add_setting :pre_loaded_fixtures
|
35
|
+
c.add_setting :global_fixtures
|
36
|
+
c.add_setting :fixture_path
|
37
|
+
c.add_setting :fixture_table_names
|
38
|
+
c.add_setting :fixture_class_names
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
metadata
ADDED
@@ -0,0 +1,126 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rspec-activerecord
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Matt Palmer
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2014-02-24 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: activerecord
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '3.1'
|
22
|
+
- - <
|
23
|
+
- !ruby/object:Gem::Version
|
24
|
+
version: '5'
|
25
|
+
type: :runtime
|
26
|
+
prerelease: false
|
27
|
+
version_requirements: !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '3.1'
|
33
|
+
- - <
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: '5'
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: git-version-bump
|
38
|
+
requirement: !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
44
|
+
type: :runtime
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: !ruby/object:Gem::Requirement
|
47
|
+
none: false
|
48
|
+
requirements:
|
49
|
+
- - ! '>='
|
50
|
+
- !ruby/object:Gem::Version
|
51
|
+
version: '0'
|
52
|
+
- !ruby/object:Gem::Dependency
|
53
|
+
name: bundler
|
54
|
+
requirement: !ruby/object:Gem::Requirement
|
55
|
+
none: false
|
56
|
+
requirements:
|
57
|
+
- - ~>
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '1.0'
|
60
|
+
type: :development
|
61
|
+
prerelease: false
|
62
|
+
version_requirements: !ruby/object:Gem::Requirement
|
63
|
+
none: false
|
64
|
+
requirements:
|
65
|
+
- - ~>
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '1.0'
|
68
|
+
- !ruby/object:Gem::Dependency
|
69
|
+
name: rdoc
|
70
|
+
requirement: !ruby/object:Gem::Requirement
|
71
|
+
none: false
|
72
|
+
requirements:
|
73
|
+
- - ~>
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '2.5'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
none: false
|
80
|
+
requirements:
|
81
|
+
- - ~>
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '2.5'
|
84
|
+
description:
|
85
|
+
email: mpalmer@hezmatt.org
|
86
|
+
executables: []
|
87
|
+
extensions: []
|
88
|
+
extra_rdoc_files:
|
89
|
+
- README.md
|
90
|
+
files:
|
91
|
+
- LICENCE
|
92
|
+
- README.md
|
93
|
+
- lib/rspec-activerecord.rb
|
94
|
+
- lib/rspec/active_record.rb
|
95
|
+
homepage: https://github.com/mpalmer/rspec-activerecord
|
96
|
+
licenses:
|
97
|
+
- GPLv3
|
98
|
+
post_install_message:
|
99
|
+
rdoc_options: []
|
100
|
+
require_paths:
|
101
|
+
- lib
|
102
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
103
|
+
none: false
|
104
|
+
requirements:
|
105
|
+
- - ! '>='
|
106
|
+
- !ruby/object:Gem::Version
|
107
|
+
version: '0'
|
108
|
+
segments:
|
109
|
+
- 0
|
110
|
+
hash: 336487240404629199
|
111
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
112
|
+
none: false
|
113
|
+
requirements:
|
114
|
+
- - ! '>='
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '0'
|
117
|
+
segments:
|
118
|
+
- 0
|
119
|
+
hash: 336487240404629199
|
120
|
+
requirements: []
|
121
|
+
rubyforge_project:
|
122
|
+
rubygems_version: 1.8.23
|
123
|
+
signing_key:
|
124
|
+
specification_version: 3
|
125
|
+
summary: ActiveRecord-only support for RSpec
|
126
|
+
test_files: []
|