transpec 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Rakefile +3 -2
- data/lib/transpec/syntax/matcher.rb +6 -1
- data/lib/transpec/version.rb +1 -1
- data/spec/spec_helper.rb +1 -0
- data/spec/transpec/syntax/matcher_spec.rb +14 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 84654b586ffec308305611b94645b31b0273c5fa
|
4
|
+
data.tar.gz: 550b871976225f5b49b79ce3e098ac69bade0071
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2a363066e3a0ad769016ba1ce600530827fe5207c8df6113bb7ab34d2fc726d014951acb6f40038617d3f14f3e6ce0b03441cb6b2aef8d40a7c227df881ad66e
|
7
|
+
data.tar.gz: efe834fdda78a29a07e461780b860107db23121be76beb2ece5529892d21b7945570e6d86888c541daaaf47300b57219cb1a383d0ad36145471c321eb779459b
|
data/CHANGELOG.md
CHANGED
data/Rakefile
CHANGED
@@ -45,10 +45,11 @@ Rake::Task[:release].enhance([:abort_unless_latest_readme_is_committed])
|
|
45
45
|
namespace :test do
|
46
46
|
projects = [
|
47
47
|
[:twitter, 'https://github.com/sferik/twitter.git', 'v4.1.0'],
|
48
|
-
[:guard, 'https://github.com/yujinakayama/guard.git', 'transpec', %w(--without development)]
|
48
|
+
[:guard, 'https://github.com/yujinakayama/guard.git', 'transpec', %w(--without development)],
|
49
|
+
[:mail, 'https://github.com/yujinakayama/mail.git', 'transpec']
|
49
50
|
]
|
50
51
|
|
51
|
-
desc 'Test Transpec on all
|
52
|
+
desc 'Test Transpec on all projects'
|
52
53
|
task :all => projects.map(&:first)
|
53
54
|
|
54
55
|
projects.each do |name, url, ref, bundler_args|
|
@@ -7,7 +7,7 @@ require 'transpec/util'
|
|
7
7
|
module Transpec
|
8
8
|
class Syntax
|
9
9
|
class Matcher < Syntax
|
10
|
-
include SendNodeSyntax, Util
|
10
|
+
include SendNodeSyntax, Util, ::AST::Sexp
|
11
11
|
|
12
12
|
def self.target_node?(node)
|
13
13
|
false
|
@@ -25,6 +25,7 @@ module Transpec
|
|
25
25
|
replace(selector_range, 'eq')
|
26
26
|
parenthesize!(parenthesize_arg)
|
27
27
|
when :===, :<, :<=, :>, :>=
|
28
|
+
return if prefixed_with_be?
|
28
29
|
insert_before(selector_range, 'be ')
|
29
30
|
when :=~
|
30
31
|
if arg_node.type == :array
|
@@ -58,6 +59,10 @@ module Transpec
|
|
58
59
|
|
59
60
|
private
|
60
61
|
|
62
|
+
def prefixed_with_be?
|
63
|
+
receiver_node == s(:send, nil, :be)
|
64
|
+
end
|
65
|
+
|
61
66
|
def left_parenthesis_range
|
62
67
|
Parser::Source::Range.new(
|
63
68
|
selector_range.source_buffer,
|
data/lib/transpec/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -235,6 +235,20 @@ module Transpec
|
|
235
235
|
rewritten_source.should == expected_source
|
236
236
|
end
|
237
237
|
end
|
238
|
+
|
239
|
+
context "when it is `be #{operator} 1` form" do
|
240
|
+
let(:source) do
|
241
|
+
<<-END
|
242
|
+
it '#{description} 1' do
|
243
|
+
subject.should be #{operator} 1
|
244
|
+
end
|
245
|
+
END
|
246
|
+
end
|
247
|
+
|
248
|
+
it 'does nothing' do
|
249
|
+
rewritten_source.should == source
|
250
|
+
end
|
251
|
+
end
|
238
252
|
end
|
239
253
|
|
240
254
|
context 'when it is `=~ /pattern/` form' do
|