transpec 0.1.0 → 0.1.1

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: abbc3182fd195b7473eea1f3bb4fcf8c7386a7c7
4
- data.tar.gz: c3ea7cfb834e1bb4a65c018416dc809da620ec84
3
+ metadata.gz: 84654b586ffec308305611b94645b31b0273c5fa
4
+ data.tar.gz: 550b871976225f5b49b79ce3e098ac69bade0071
5
5
  SHA512:
6
- metadata.gz: 36bc1599b648b15dc9ab19f66e45e105a521886832179e2ef29643ddb28519d233d2e6a7ee2de34c6bbc2dfbe316ba84d4f9a95175d900fe6b671113d49b7e82
7
- data.tar.gz: cdf7b01444576de368f5359b79d0e98561e96d624e090ed6df1cfb9f17457d3c7c752cfac8d6e9ee882bbd4ea67c6f34804ca47657f78ddef9bec3382cbdf34e
6
+ metadata.gz: 2a363066e3a0ad769016ba1ce600530827fe5207c8df6113bb7ab34d2fc726d014951acb6f40038617d3f14f3e6ce0b03441cb6b2aef8d40a7c227df881ad66e
7
+ data.tar.gz: efe834fdda78a29a07e461780b860107db23121be76beb2ece5529892d21b7945570e6d86888c541daaaf47300b57219cb1a383d0ad36145471c321eb779459b
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## Master
4
4
 
5
+ ## v0.1.1
6
+
7
+ * Fix a bug where `be > 1` was converted into `be be > 1`
8
+
5
9
  ## v0.1.0
6
10
 
7
11
  * Highlight source in console when warning conversion error
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 other projects'
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,
@@ -5,7 +5,7 @@ module Transpec
5
5
  module Version
6
6
  MAJOR = 0
7
7
  MINOR = 1
8
- PATCH = 0
8
+ PATCH = 1
9
9
 
10
10
  def self.to_s
11
11
  [MAJOR, MINOR, PATCH].join('.')
data/spec/spec_helper.rb CHANGED
@@ -15,6 +15,7 @@ RSpec.configure do |config|
15
15
  config.filter_run_excluding do_not_run_in_converted_spec: ENV['TRANSPEC_CONVERTED_SPEC']
16
16
 
17
17
  config.before(:all) do
18
+ require 'rainbow'
18
19
  Sickill::Rainbow.enabled = false
19
20
 
20
21
  if ENV['TRAVIS']
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: transpec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuji Nakayama