immutability 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b5b988e1aad5ffa23a6021cd8ef3a93eb996a8f0
4
- data.tar.gz: 534a78582224f3587a0e72af50423c40d10fc9ad
3
+ metadata.gz: f099da696ee2965d0705383a8bfca47d89736b0d
4
+ data.tar.gz: 9af0b157ad8256d860d48233fbbe0c005838c13b
5
5
  SHA512:
6
- metadata.gz: 50569698c05f0ff753b6a865c12aa2241653fa966fcf8404aba2781bf0c0553755520aeb7c02e4bcd5a7c4d4fb6508861a4af8beba4c595dcbb37075ff96fb49
7
- data.tar.gz: 76ba454dc1c64cabefe26ad0baa6a584473564cc0ff234862e86a234655f3b400405ba6e0047f0411a6c7952679847c83e34c0b4866bb8b1c78d95bb6af6ae1f
6
+ metadata.gz: 48b3e52146ebc88bb67d639ea32405e35aabca31104fa951c9d0a1c28e9a2182951a114782b702312095989316c9a39e202739b38f16ec1185bb12b8561838fa
7
+ data.tar.gz: ea4c83cee676dd5f39129dfe63428cd2bfd35aa447d4d6d1267606b92be0dd4d5e80a59e305d22904e2044f5b88d45562b036c5f2f59e24f40c1e39f1542e8ce
data/CHANGELOG.md CHANGED
@@ -1,4 +1,12 @@
1
- ## v0.0.4 2015-09-10
1
+ ## v0.0.5 to be released
2
+
3
+ ### Bugs fixed
4
+
5
+ - `frozen_double` can be provided without options (nepalez)
6
+
7
+ [Compare v0.0.4...v0.0.5](https://github.com/nepalez/immutability/compare/v0.0.4...v0.0.5)
8
+
9
+ ## v0.0.4 2015-10-09
2
10
 
3
11
  The small release (backward-compatible) adds `frozen_double` to rspec helper methods.
4
12
 
data/README.md CHANGED
@@ -162,7 +162,7 @@ The matcher will pass if both the object and all its variables are immutable at
162
162
 
163
163
  ### frozen_double
164
164
 
165
- Initializers of immutable objects freeze their variables deeply. When you send doubles as arguments for this initializer, RSpec will warn you about trying to freeze that double. To avoid the problem, use `frozen_double` instead of `double`:
165
+ Initializers of immutable objects freeze variables deeply. When you use doubles as initializers' arguments, `RSpec` will complain. To avoid this problem, use `frozen_double` instead of `double`:
166
166
 
167
167
  ```ruby
168
168
  include "immutability/rspec"
@@ -170,6 +170,7 @@ include "immutability/rspec"
170
170
  describe User, "#name" do
171
171
  subject { User.new(name, 44).name }
172
172
 
173
+ # the name can be used by the initializer safely
173
174
  let(:name) { frozen_double :name, to_s: "Andrew" }
174
175
 
175
176
  it { is_expected.to eql "Andrew" }
@@ -4,6 +4,6 @@ module Immutability
4
4
 
5
5
  # The semantic version of the gem.
6
6
  # @see http://semver.org/ Semantic versioning 2.0
7
- VERSION = "0.0.4".freeze
7
+ VERSION = "0.0.5".freeze
8
8
 
9
9
  end # module Immutability
@@ -5,7 +5,7 @@ RSpec.configure do |config|
5
5
  # Returns the double with +#frozen?+ and +#freeze+ methods defined
6
6
  #
7
7
  def frozen_double(*args)
8
- options = args.pop if args.last.instance_of?(Hash)
8
+ options = args.last.instance_of?(Hash) ? args.pop : {}
9
9
  name = args.first
10
10
  instance = double name, options.merge(frozen?: true)
11
11
  allow(instance).to receive(:freeze).and_return(instance)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: immutability
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kozin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-09 00:00:00.000000000 Z
11
+ date: 2015-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ice_nine