test_dummy 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +20 -0
- data/VERSION +1 -1
- data/lib/test_dummy.rb +1 -1
- data/test_dummy.gemspec +2 -2
- metadata +3 -3
data/README.rdoc
CHANGED
@@ -22,6 +22,26 @@ declare how to dummy something:
|
|
22
22
|
dummy :nickname, :use => :random_phonetic_string
|
23
23
|
end
|
24
24
|
|
25
|
+
Dummy configuration can also be stored in test/dummy to avoid cluttering
|
26
|
+
your models up with generators. An equivalent external declaration would look
|
27
|
+
like this:
|
28
|
+
|
29
|
+
TestDummy.declare(MyModel) do
|
30
|
+
dummy :name do
|
31
|
+
"user%d" % rand(10e6)
|
32
|
+
end
|
33
|
+
|
34
|
+
dummy :password, :password_confirmation do
|
35
|
+
'tester'
|
36
|
+
end
|
37
|
+
|
38
|
+
dummy :nickname, :use => :random_phonetic_string
|
39
|
+
end
|
40
|
+
|
41
|
+
The name of the test/dummy file should be the same as the main model
|
42
|
+
defined in app/models. For instance, app/models/my_model.rb would have a
|
43
|
+
corresponding test/dummy/my_model.rb that would be loaded as required.
|
44
|
+
|
25
45
|
== Copyright
|
26
46
|
|
27
47
|
Copyright (c) 2010 Scott Tadman, The Working Group
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.2
|
data/lib/test_dummy.rb
CHANGED
@@ -125,7 +125,7 @@ module TestDummy
|
|
125
125
|
unless (defined?(@_dummy_module))
|
126
126
|
@_dummy_module =
|
127
127
|
begin
|
128
|
-
dummy_path = File.expand_path("
|
128
|
+
dummy_path = File.expand_path("test/dummy/#{name.underscore}.rb", Rails.root)
|
129
129
|
|
130
130
|
if (File.exist?(dummy_path))
|
131
131
|
require dummy_path
|
data/test_dummy.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{test_dummy}
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["tadman"]
|
12
|
-
s.date = %q{2010-10-
|
12
|
+
s.date = %q{2010-10-27}
|
13
13
|
s.description = %q{Test Dummy allows you to define how to fake models automatically so that you can use dummy data for testing instead of fixtures. Dummy models are always generated using the current schema and don't need to me migrated like fixtures.}
|
14
14
|
s.email = %q{github@tadman.ca}
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 2
|
8
|
-
-
|
9
|
-
version: 0.2.
|
8
|
+
- 2
|
9
|
+
version: 0.2.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- tadman
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-10-
|
17
|
+
date: 2010-10-27 00:00:00 -04:00
|
18
18
|
default_executable:
|
19
19
|
dependencies: []
|
20
20
|
|