transpec 2.2.4 → 2.2.5
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/CHANGELOG.md +4 -0
- data/lib/transpec/syntax/method_stub.rb +1 -1
- data/lib/transpec/version.rb +1 -1
- data/spec/transpec/syntax/method_stub_spec.rb +26 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6344cbf3016bb43e49fb70dbe7a4105439b45ef0
|
4
|
+
data.tar.gz: 8e5692f353278c6cf1cf120d582c504c9859493c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 163b3f743c5033a58d8a4c8643f2b71e7c771e79a0183f8c785f56f6fa59fad65e83f291c20973ecc1354fcb453909451f2384d1a7a1617df972a77820502964
|
7
|
+
data.tar.gz: 6e68356769b715ea2becfcfea1d8e80807b973b2d6322022b79438400b0ffa64fee65b0a82835ecd9284b133017bfcb882f968f26c7a86f2ed65cc7856d80cce
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
## Development
|
4
4
|
|
5
|
+
## v2.2.5
|
6
|
+
|
7
|
+
* Fix invalid conversion of `unstub` without parentheses (`obj.unstub :message`). ([#74](https://github.com/yujinakayama/transpec/pull/74))
|
8
|
+
|
5
9
|
## v2.2.4
|
6
10
|
|
7
11
|
* Avoid crash on invalid `expect` syntax expectations (e.g. `expect(obj)` without following `to` or `expect(obj).to` taking no matcher). ([#71](https://github.com/yujinakayama/transpec/issues/71))
|
@@ -109,7 +109,7 @@ module Transpec
|
|
109
109
|
[build_multiple_allow_to_receive_with_hash(arg_node), :allow_to_receive]
|
110
110
|
end
|
111
111
|
else
|
112
|
-
[build_allow_to_receive(arg_node), :allow_to_receive]
|
112
|
+
[build_allow_to_receive(arg_node, nil, !unstub?), :allow_to_receive]
|
113
113
|
end
|
114
114
|
end
|
115
115
|
end
|
data/lib/transpec/version.rb
CHANGED
@@ -705,6 +705,32 @@ module Transpec
|
|
705
705
|
end
|
706
706
|
end
|
707
707
|
|
708
|
+
context 'with expression `obj.unstub :message`' do
|
709
|
+
let(:source) do
|
710
|
+
<<-END
|
711
|
+
describe 'example' do
|
712
|
+
it 'does not respond to #foo' do
|
713
|
+
subject.unstub :foo
|
714
|
+
end
|
715
|
+
end
|
716
|
+
END
|
717
|
+
end
|
718
|
+
|
719
|
+
let(:expected_source) do
|
720
|
+
<<-END
|
721
|
+
describe 'example' do
|
722
|
+
it 'does not respond to #foo' do
|
723
|
+
allow(subject).to receive(:foo).and_call_original
|
724
|
+
end
|
725
|
+
end
|
726
|
+
END
|
727
|
+
end
|
728
|
+
|
729
|
+
it 'converts to `allow(subject).to receive(:method).and_call_original`' do
|
730
|
+
rewritten_source.should == expected_source
|
731
|
+
end
|
732
|
+
end
|
733
|
+
|
708
734
|
context 'with expression `Klass.any_instance.stub(:message)`' do
|
709
735
|
let(:source) do
|
710
736
|
<<-END
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: transpec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuji Nakayama
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-06-
|
11
|
+
date: 2014-06-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parser
|
@@ -404,7 +404,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
404
404
|
version: '0'
|
405
405
|
requirements: []
|
406
406
|
rubyforge_project:
|
407
|
-
rubygems_version: 2.
|
407
|
+
rubygems_version: 2.3.0
|
408
408
|
signing_key:
|
409
409
|
specification_version: 4
|
410
410
|
summary: The RSpec syntax converter
|