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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 50cf581e1b4b693c14936b60f01fa2d0f3d51664
4
- data.tar.gz: a12752f43dd59710089327dd7d481215fac631df
3
+ metadata.gz: 56cab5cab4392dc203b54085d0372e12b0802e3c
4
+ data.tar.gz: cb8e351b30c3cb82db0301ef8403405d931f9f3f
5
5
  SHA512:
6
- metadata.gz: a00f590d9b3ccae87ef6cbd8966ebd958cff872d5587a414ea3ec044538bfa56ffb138e291c214ed80fcedf8dacc2203860638cefe2c5338cb878a3ef22bf76c
7
- data.tar.gz: 6b02be8c8a28ccb1b03a36a75ff283671046453525c60478db7e605f4bf95c2ea932fec2ff9670bd7a934843fdf1aa3477068eb03ea8848979920d283737a548
6
+ metadata.gz: e783319c44f1d8d3e33dedb0b77dbc1fb8231e9ac642847b3d5c1b9c7f233e2ad96cddf0d017c27f872c181c69f03743a208869d7623c482fcec65965a69b705
7
+ data.tar.gz: 717b3edd11e5eb0c175daad82306d39ba3e86e7c7e82ca0a9b0dd08cbb7fdca7b3eaf69cea7fc96e6b8d47588fde83ec29888bb7aa514edf61eca70167d9c61d
@@ -5,10 +5,9 @@ rvm:
5
5
  - 1.9.3
6
6
  - 2.0.0
7
7
  - 2.1.10
8
- - 2.2.7
9
- - 2.3.3
10
- - 2.4.1
8
+ - 2.2
9
+ - 2.3
10
+ - 2.4
11
11
  - jruby-18mode
12
12
  - jruby-19mode
13
13
  - jruby-head
14
- - rbx-3.84
@@ -1,8 +1,12 @@
1
1
  # master (unreleased)
2
2
 
3
+ # 2.0.0
4
+
5
+ * Use `save!` instead of `save` for sham calls.
6
+
3
7
  # 1.2.0
4
8
 
5
- - Add `Sham::Lazy` type.
9
+ * Add `Sham::Lazy` type.
6
10
 
7
11
  # 1.1.0
8
12
 
@@ -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` will also be called unless the
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
@@ -17,8 +17,8 @@ module Sham
17
17
  object.public_send("#{key}=", value)
18
18
  end
19
19
 
20
- if !build && object.respond_to?(:save)
21
- object.save
20
+ if !build && object.respond_to?(:save!)
21
+ object.save!
22
22
  end
23
23
 
24
24
  object
@@ -1,3 +1,3 @@
1
1
  module Sham
2
- VERSION = "1.2.0"
2
+ VERSION = "2.0.0"
3
3
  end
@@ -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: 1.2.0
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: 2017-08-10 00:00:00.000000000 Z
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.5.1
107
+ rubygems_version: 2.6.11
108
108
  signing_key:
109
109
  specification_version: 4
110
- summary: sham-1.2.0
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