sham 1.0.1 → 1.0.2
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/.gitignore +1 -0
- data/lib/sham/shammable.rb +2 -1
- data/lib/sham/version.rb +1 -1
- data/spec/root/sham/employee.rb +2 -2
- data/spec/sham/base_spec.rb +1 -1
- data/spec/sham/config_spec.rb +5 -5
- data/spec/sham/util_spec.rb +1 -1
- data/spec/spec_helper.rb +5 -5
- metadata +5 -5
data/.gitignore
CHANGED
data/lib/sham/shammable.rb
CHANGED
data/lib/sham/version.rb
CHANGED
data/spec/root/sham/employee.rb
CHANGED
data/spec/sham/base_spec.rb
CHANGED
data/spec/sham/config_spec.rb
CHANGED
@@ -38,7 +38,7 @@ describe Sham::Config do
|
|
38
38
|
|
39
39
|
expect {
|
40
40
|
Sham.config(BiggestCompany){ |c| c.empty }
|
41
|
-
}.to change{ BiggestCompany.respond_to?(:sham_alternate!) }
|
41
|
+
}.to change{ BiggestCompany.respond_to?(:sham_alternate!) } \
|
42
42
|
.from(false).to(true)
|
43
43
|
end
|
44
44
|
|
@@ -55,7 +55,7 @@ describe Sham::Config do
|
|
55
55
|
|
56
56
|
Sham.config(PowerUser){ |c| c.empty }
|
57
57
|
|
58
|
-
User.sham_config(:default)
|
58
|
+
User.sham_config(:default) \
|
59
59
|
.should_not == PowerUser.sham_config(:default)
|
60
60
|
end
|
61
61
|
|
@@ -96,7 +96,7 @@ describe Sham::Config do
|
|
96
96
|
end
|
97
97
|
|
98
98
|
it 'should sham alternatives with alternative options' do
|
99
|
-
User.sham!(:super)[:identifier]
|
99
|
+
User.sham!(:super)[:identifier] \
|
100
100
|
.should_not == User.sham![:identifier]
|
101
101
|
end
|
102
102
|
|
@@ -109,10 +109,10 @@ describe Sham::Config do
|
|
109
109
|
it 'should allow nested shams to be overwritten' do
|
110
110
|
profile = Profile.new
|
111
111
|
|
112
|
-
User.sham!(:with_profile, profile
|
112
|
+
User.sham!(:with_profile, :profile => profile)[:profile] \
|
113
113
|
.should == profile
|
114
114
|
|
115
|
-
User.sham!(:with_profile)[:profile]
|
115
|
+
User.sham!(:with_profile)[:profile] \
|
116
116
|
.should_not == profile
|
117
117
|
end
|
118
118
|
end
|
data/spec/sham/util_spec.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -22,16 +22,16 @@ end
|
|
22
22
|
Sham.config(User) do |c|
|
23
23
|
c.attributes do
|
24
24
|
{
|
25
|
-
name
|
26
|
-
email
|
27
|
-
identifier
|
25
|
+
:name => Sham.string!,
|
26
|
+
:email => "#{Sham.string!}@gmail.com",
|
27
|
+
:identifier => 100
|
28
28
|
}
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
32
|
Sham.config(User, :super) do |c|
|
33
33
|
c.attributes do
|
34
|
-
{ identifier
|
34
|
+
{ :identifier => 200 }
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
@@ -39,7 +39,7 @@ class Profile < User; end
|
|
39
39
|
|
40
40
|
Sham.config(User, :with_profile) do |c|
|
41
41
|
c.attributes do
|
42
|
-
{ profile
|
42
|
+
{ :profile => Sham::Base.new(Profile) }
|
43
43
|
end
|
44
44
|
end
|
45
45
|
Sham.config(Profile){ |c| c.empty }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sham
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-
|
12
|
+
date: 2011-11-03 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement: &
|
16
|
+
requirement: &70137106338160 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70137106338160
|
25
25
|
description: Lightweight flexible factories for Ruby and Rails testing.
|
26
26
|
email:
|
27
27
|
- pan.thomakos@gmail.com
|
@@ -75,7 +75,7 @@ rubyforge_project: sham
|
|
75
75
|
rubygems_version: 1.8.6
|
76
76
|
signing_key:
|
77
77
|
specification_version: 3
|
78
|
-
summary: sham-1.0.
|
78
|
+
summary: sham-1.0.2
|
79
79
|
test_files:
|
80
80
|
- spec/root/sham/employee.rb
|
81
81
|
- spec/sham/base_spec.rb
|