sham 1.2.0 → 2.0.0
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.
- checksums.yaml +4 -4
- data/.travis.yml +3 -4
- data/CHANGES.markdown +5 -1
- data/README.markdown +3 -3
- data/lib/sham/config/assign.rb +2 -2
- data/lib/sham/version.rb +1 -1
- data/spec/lib/sham/config/assign_spec.rb +5 -5
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 56cab5cab4392dc203b54085d0372e12b0802e3c
|
4
|
+
data.tar.gz: cb8e351b30c3cb82db0301ef8403405d931f9f3f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e783319c44f1d8d3e33dedb0b77dbc1fb8231e9ac642847b3d5c1b9c7f233e2ad96cddf0d017c27f872c181c69f03743a208869d7623c482fcec65965a69b705
|
7
|
+
data.tar.gz: 717b3edd11e5eb0c175daad82306d39ba3e86e7c7e82ca0a9b0dd08cbb7fdca7b3eaf69cea7fc96e6b8d47588fde83ec29888bb7aa514edf61eca70167d9c61d
|
data/.travis.yml
CHANGED
data/CHANGES.markdown
CHANGED
data/README.markdown
CHANGED
@@ -49,7 +49,7 @@ Sham can also create objects without automatically saving using the `:build`
|
|
49
49
|
option.
|
50
50
|
|
51
51
|
user = User.sham!(:build, :name => "I have not been saved")
|
52
|
-
user.save
|
52
|
+
user.save!
|
53
53
|
|
54
54
|
## RSpec Example
|
55
55
|
|
@@ -154,11 +154,11 @@ initializer, you can use the `assign` configuration.
|
|
154
154
|
end
|
155
155
|
|
156
156
|
When executing `User.sham!` all attributes will be assigned using the instance
|
157
|
-
setters instead of the initializer. A `save
|
157
|
+
setters instead of the initializer. A `save!` will also be called unless the
|
158
158
|
`:build` parameters is used.
|
159
159
|
|
160
160
|
User.any_instance.should_receive(:name=).with('Jane Doe')
|
161
|
-
User.any_instance.should_receive(:save)
|
161
|
+
User.any_instance.should_receive(:save!)
|
162
162
|
User.sham!(:name => 'Jane Doe')
|
163
163
|
|
164
164
|
## Empty Shams
|
data/lib/sham/config/assign.rb
CHANGED
data/lib/sham/version.rb
CHANGED
@@ -40,19 +40,19 @@ describe Sham::Config::Assign do
|
|
40
40
|
end
|
41
41
|
|
42
42
|
it 'calls save if the instance responds to save' do
|
43
|
-
instance.stub(:respond_to?).with(:save){ true }
|
44
|
-
instance.should_receive(:save)
|
43
|
+
instance.stub(:respond_to?).with(:save!){ true }
|
44
|
+
instance.should_receive(:save!)
|
45
45
|
config.options.sham
|
46
46
|
end
|
47
47
|
|
48
48
|
it 'does not call save on build' do
|
49
|
-
instance.should_recieve(:save).never
|
49
|
+
instance.should_recieve(:save!).never
|
50
50
|
config.options.sham(true)
|
51
51
|
end
|
52
52
|
|
53
53
|
it 'does not call save if it does not respond to save' do
|
54
|
-
instance.stub(:respond_to?).with(:save){ false }
|
55
|
-
instance.should_receive(:save).never
|
54
|
+
instance.stub(:respond_to?).with(:save!){ false }
|
55
|
+
instance.should_receive(:save!).never
|
56
56
|
config.options.sham
|
57
57
|
end
|
58
58
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sham
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pan Thomakos
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-02-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -104,10 +104,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
104
104
|
version: '0'
|
105
105
|
requirements: []
|
106
106
|
rubyforge_project: sham
|
107
|
-
rubygems_version: 2.
|
107
|
+
rubygems_version: 2.6.11
|
108
108
|
signing_key:
|
109
109
|
specification_version: 4
|
110
|
-
summary: sham-
|
110
|
+
summary: sham-2.0.0
|
111
111
|
test_files:
|
112
112
|
- spec/lib/sham/base_spec.rb
|
113
113
|
- spec/lib/sham/config/assign_spec.rb
|