ripper_ruby_parser 1.1.1 → 1.1.2

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.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +19 -0
  3. data/Rakefile +2 -2
  4. data/lib/ripper_ruby_parser/commenting_ripper_parser.rb +55 -4
  5. data/lib/ripper_ruby_parser/sexp_handlers/blocks.rb +20 -13
  6. data/lib/ripper_ruby_parser/sexp_handlers/conditionals.rb +27 -12
  7. data/lib/ripper_ruby_parser/sexp_handlers/hashes.rb +25 -12
  8. data/lib/ripper_ruby_parser/sexp_handlers/helper_methods.rb +4 -2
  9. data/lib/ripper_ruby_parser/sexp_handlers/literals.rb +19 -15
  10. data/lib/ripper_ruby_parser/sexp_handlers/loops.rb +25 -11
  11. data/lib/ripper_ruby_parser/sexp_handlers/method_calls.rb +12 -4
  12. data/lib/ripper_ruby_parser/sexp_handlers/methods.rb +8 -4
  13. data/lib/ripper_ruby_parser/sexp_handlers/operators.rb +1 -5
  14. data/lib/ripper_ruby_parser/version.rb +1 -1
  15. data/lib/ripper_ruby_parser.rb +2 -2
  16. data/test/end_to_end/comments_test.rb +4 -4
  17. data/test/end_to_end/comparison_test.rb +15 -15
  18. data/test/end_to_end/error_conditions_test.rb +16 -16
  19. data/test/end_to_end/lib_comparison_test.rb +3 -3
  20. data/test/end_to_end/line_numbering_test.rb +4 -4
  21. data/test/end_to_end/samples_comparison_test.rb +4 -4
  22. data/test/end_to_end/test_comparison_test.rb +3 -3
  23. data/test/pt_testcase/pt_test.rb +4 -4
  24. data/test/test_helper.rb +1 -1
  25. data/test/unit/commenting_ripper_parser_test.rb +33 -33
  26. data/test/unit/parser_assignment_test.rb +30 -30
  27. data/test/unit/parser_blocks_test.rb +83 -65
  28. data/test/unit/parser_conditionals_test.rb +96 -64
  29. data/test/unit/parser_literals_test.rb +308 -212
  30. data/test/unit/parser_loops_test.rb +85 -15
  31. data/test/unit/parser_method_calls_test.rb +100 -41
  32. data/test/unit/parser_operators_test.rb +60 -28
  33. data/test/unit/parser_test.rb +435 -410
  34. data/test/unit/sexp_processor_test.rb +82 -82
  35. data/test/unit/version_test.rb +1 -1
  36. metadata +2 -2
@@ -1,7 +1,7 @@
1
1
  require File.expand_path('../test_helper.rb', File.dirname(__FILE__))
2
2
  require 'ruby_parser'
3
3
 
4
- describe "Using RipperRubyParser and RubyParser" do
4
+ describe 'Using RipperRubyParser and RubyParser' do
5
5
  let :newparser do
6
6
  RipperRubyParser::Parser.new
7
7
  end
@@ -10,12 +10,12 @@ describe "Using RipperRubyParser and RubyParser" do
10
10
  RubyParser.new
11
11
  end
12
12
 
13
- describe "for a simple well known program" do
13
+ describe 'for a simple well known program' do
14
14
  let :program do
15
15
  "puts 'Hello World'"
16
16
  end
17
17
 
18
- it "gives the same result" do
18
+ it 'gives the same result' do
19
19
  original = oldparser.parse program
20
20
  imitation = newparser.parse program
21
21
 
@@ -23,7 +23,7 @@ describe "Using RipperRubyParser and RubyParser" do
23
23
  end
24
24
  end
25
25
 
26
- describe "for a more complex program" do
26
+ describe 'for a more complex program' do
27
27
  let :program do
28
28
  <<-END
29
29
  module Quux
@@ -44,7 +44,7 @@ describe "Using RipperRubyParser and RubyParser" do
44
44
  END
45
45
  end
46
46
 
47
- it "gives the same result" do
47
+ it 'gives the same result' do
48
48
  original = oldparser.parse program
49
49
  imitation = newparser.parse program
50
50
 
@@ -52,12 +52,12 @@ describe "Using RipperRubyParser and RubyParser" do
52
52
  end
53
53
  end
54
54
 
55
- describe "for an example with yield from Reek" do
55
+ describe 'for an example with yield from Reek' do
56
56
  let :program do
57
57
  'def fred() yield(3) if block_given?; end'
58
58
  end
59
59
 
60
- it "gives the same result" do
60
+ it 'gives the same result' do
61
61
  original = oldparser.parse program
62
62
  imitation = newparser.parse program
63
63
 
@@ -65,7 +65,7 @@ describe "Using RipperRubyParser and RubyParser" do
65
65
  end
66
66
  end
67
67
 
68
- describe "for an example with floats from Reek" do
68
+ describe 'for an example with floats from Reek' do
69
69
  let :program do
70
70
  <<-END
71
71
  def total_envy
@@ -78,7 +78,7 @@ describe "Using RipperRubyParser and RubyParser" do
78
78
  END
79
79
  end
80
80
 
81
- it "gives the same result" do
81
+ it 'gives the same result' do
82
82
  original = oldparser.parse program
83
83
  imitation = newparser.parse program
84
84
 
@@ -86,7 +86,7 @@ describe "Using RipperRubyParser and RubyParser" do
86
86
  end
87
87
  end
88
88
 
89
- describe "for an example with operators and explicit block parameter from Reek" do
89
+ describe 'for an example with operators and explicit block parameter from Reek' do
90
90
  let :program do
91
91
  <<-END
92
92
  def parse(arg, argv, &error)
@@ -105,7 +105,7 @@ describe "Using RipperRubyParser and RubyParser" do
105
105
  END
106
106
  end
107
107
 
108
- it "gives the same result" do
108
+ it 'gives the same result' do
109
109
  original = oldparser.parse program
110
110
  imitation = newparser.parse program
111
111
 
@@ -113,12 +113,12 @@ describe "Using RipperRubyParser and RubyParser" do
113
113
  end
114
114
  end
115
115
 
116
- describe "for an example of a complex regular expression from Reek" do
116
+ describe 'for an example of a complex regular expression from Reek' do
117
117
  let :program do
118
118
  "/(\#{@types})\\s*(\\w+)\\s*\\(([^)]*)\\)/"
119
119
  end
120
120
 
121
- it "gives the same result" do
121
+ it 'gives the same result' do
122
122
  original = oldparser.parse program
123
123
  imitation = newparser.parse program
124
124
 
@@ -126,8 +126,8 @@ describe "Using RipperRubyParser and RubyParser" do
126
126
  end
127
127
  end
128
128
 
129
- describe "for an example with regular expressions with different encoding flags" do
130
- it "gives the same result" do
129
+ describe 'for an example with regular expressions with different encoding flags' do
130
+ it 'gives the same result' do
131
131
  program = <<-END
132
132
  regular = /foo/
133
133
  noenc = /foo/n
@@ -1,50 +1,50 @@
1
1
  require File.expand_path('../test_helper.rb', File.dirname(__FILE__))
2
2
 
3
- describe "Handling errors" do
4
- describe "RipperRubyParser::Parser#parse" do
3
+ describe 'Handling errors' do
4
+ describe 'RipperRubyParser::Parser#parse' do
5
5
  let :newparser do
6
6
  RipperRubyParser::Parser.new
7
7
  end
8
8
 
9
- it "raises an error for an incomplete source" do
9
+ it 'raises an error for an incomplete source' do
10
10
  proc {
11
- newparser.parse "def foo"
11
+ newparser.parse 'def foo'
12
12
  }.must_raise RipperRubyParser::SyntaxError
13
13
  end
14
14
 
15
- it "raises an error for an invalid class name" do
15
+ it 'raises an error for an invalid class name' do
16
16
  proc {
17
- newparser.parse("class foo; end")
17
+ newparser.parse('class foo; end')
18
18
  }.must_raise RipperRubyParser::SyntaxError
19
19
  end
20
20
 
21
- it "raises an error aliasing $1 as foo" do
21
+ it 'raises an error aliasing $1 as foo' do
22
22
  proc {
23
- newparser.parse "alias foo $1"
23
+ newparser.parse 'alias foo $1'
24
24
  }.must_raise RipperRubyParser::SyntaxError
25
25
  end
26
26
 
27
- it "raises an error aliasing foo as $1" do
27
+ it 'raises an error aliasing foo as $1' do
28
28
  proc {
29
- newparser.parse "alias $1 foo"
29
+ newparser.parse 'alias $1 foo'
30
30
  }.must_raise RipperRubyParser::SyntaxError
31
31
  end
32
32
 
33
- it "raises an error aliasing $2 as $1" do
33
+ it 'raises an error aliasing $2 as $1' do
34
34
  proc {
35
- newparser.parse "alias $1 $2"
35
+ newparser.parse 'alias $1 $2'
36
36
  }.must_raise RipperRubyParser::SyntaxError
37
37
  end
38
38
 
39
- it "raises an error assigning to $1" do
39
+ it 'raises an error assigning to $1' do
40
40
  proc {
41
- newparser.parse "$1 = foo"
41
+ newparser.parse '$1 = foo'
42
42
  }.must_raise RipperRubyParser::SyntaxError
43
43
  end
44
44
 
45
- it "raises an error using an invalid parameter name" do
45
+ it 'raises an error using an invalid parameter name' do
46
46
  proc {
47
- newparser.parse "def foo(BAR); end"
47
+ newparser.parse 'def foo(BAR); end'
48
48
  }.must_raise RipperRubyParser::SyntaxError
49
49
  end
50
50
  end
@@ -1,7 +1,7 @@
1
1
  require File.expand_path('../test_helper.rb', File.dirname(__FILE__))
2
2
  require 'ruby_parser'
3
3
 
4
- describe "Using RipperRubyParser and RubyParser" do
4
+ describe 'Using RipperRubyParser and RubyParser' do
5
5
  let :newparser do
6
6
  RipperRubyParser::Parser.new
7
7
  end
@@ -10,13 +10,13 @@ describe "Using RipperRubyParser and RubyParser" do
10
10
  RubyParser.new
11
11
  end
12
12
 
13
- Dir.glob("lib/**/*.rb").each do |file|
13
+ Dir.glob('lib/**/*.rb').each do |file|
14
14
  describe "for #{file}" do
15
15
  let :program do
16
16
  File.read file
17
17
  end
18
18
 
19
- it "gives the same result" do
19
+ it 'gives the same result' do
20
20
  original = oldparser.parse program
21
21
  imitation = newparser.parse program
22
22
 
@@ -1,7 +1,7 @@
1
1
  require File.expand_path('../test_helper.rb', File.dirname(__FILE__))
2
2
  require 'ruby_parser'
3
3
 
4
- describe "Using RipperRubyParser and RubyParser" do
4
+ describe 'Using RipperRubyParser and RubyParser' do
5
5
  def to_line_numbers exp
6
6
  exp.map! do |sub_exp|
7
7
  if sub_exp.is_a? Sexp
@@ -26,7 +26,7 @@ describe "Using RipperRubyParser and RubyParser" do
26
26
  RubyParser.new
27
27
  end
28
28
 
29
- describe "for a multi-line program" do
29
+ describe 'for a multi-line program' do
30
30
  let :program do
31
31
  <<-END
32
32
  class Foo
@@ -50,11 +50,11 @@ describe "Using RipperRubyParser and RubyParser" do
50
50
  newparser.parse program
51
51
  end
52
52
 
53
- it "gives the same result" do
53
+ it 'gives the same result' do
54
54
  imitation.must_equal original
55
55
  end
56
56
 
57
- it "gives the same result with line numbers" do
57
+ it 'gives the same result with line numbers' do
58
58
  formatted(to_line_numbers(imitation)).
59
59
  must_equal formatted(to_line_numbers(original))
60
60
  end
@@ -1,7 +1,7 @@
1
1
  require File.expand_path('../test_helper.rb', File.dirname(__FILE__))
2
2
  require 'ruby_parser'
3
3
 
4
- describe "Using RipperRubyParser and RubyParser" do
4
+ describe 'Using RipperRubyParser and RubyParser' do
5
5
  let :newparser do
6
6
  RipperRubyParser::Parser.new
7
7
  end
@@ -10,7 +10,7 @@ describe "Using RipperRubyParser and RubyParser" do
10
10
  RubyParser.new
11
11
  end
12
12
 
13
- Dir.glob(File.expand_path("../samples/*.rb", File.dirname(__FILE__))).each do |file|
13
+ Dir.glob(File.expand_path('../samples/*.rb', File.dirname(__FILE__))).each do |file|
14
14
  describe "for #{file}" do
15
15
  let :program do
16
16
  File.read file
@@ -25,11 +25,11 @@ describe "Using RipperRubyParser and RubyParser" do
25
25
  newparser.parse program
26
26
  end
27
27
 
28
- it "gives the same result" do
28
+ it 'gives the same result' do
29
29
  formatted(imitation).must_equal formatted(original)
30
30
  end
31
31
 
32
- it "gives the same result with comments" do
32
+ it 'gives the same result with comments' do
33
33
  formatted(to_comments(imitation)).
34
34
  must_equal formatted(to_comments(original))
35
35
  end
@@ -1,7 +1,7 @@
1
1
  require File.expand_path('../test_helper.rb', File.dirname(__FILE__))
2
2
  require 'ruby_parser'
3
3
 
4
- describe "Using RipperRubyParser and RubyParser" do
4
+ describe 'Using RipperRubyParser and RubyParser' do
5
5
  let :newparser do
6
6
  RipperRubyParser::Parser.new
7
7
  end
@@ -10,13 +10,13 @@ describe "Using RipperRubyParser and RubyParser" do
10
10
  RubyParser.new
11
11
  end
12
12
 
13
- Dir.glob("test/**/*.rb").each do |file|
13
+ Dir.glob('test/**/*.rb').each do |file|
14
14
  describe "for #{file}" do
15
15
  let :program do
16
16
  File.read file
17
17
  end
18
18
 
19
- it "gives the same result" do
19
+ it 'gives the same result' do
20
20
  # Clone string because ruby_parser destroys it when there's a heredoc
21
21
  # inside.
22
22
  copy = program.clone
@@ -7,17 +7,17 @@ class TestParser < RipperRubyParser::Parser
7
7
  end
8
8
  end
9
9
 
10
- SKIPPED_TESTS = ["dstr_heredoc_windoze_sucks"].freeze
10
+ SKIPPED_TESTS = ['dstr_heredoc_windoze_sucks'].freeze
11
11
 
12
12
  class RubyParserTestCase < ParseTreeTestCase
13
13
  def self.previous _key
14
- "Ruby"
14
+ 'Ruby'
15
15
  end
16
16
 
17
17
  def self.generate_test klass, node, data, input_name, output_name
18
18
  if data['Ruby'].is_a? Array
19
19
  klass.send :define_method, "test_#{node}" do
20
- skip "Not a parser test"
20
+ skip 'Not a parser test'
21
21
  end
22
22
  return
23
23
  end
@@ -29,7 +29,7 @@ class RubyParserTestCase < ParseTreeTestCase
29
29
  return
30
30
  end
31
31
 
32
- output_name = "ParseTree"
32
+ output_name = 'ParseTree'
33
33
 
34
34
  super
35
35
  end
data/test/test_helper.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require 'simplecov'
2
2
  SimpleCov.start do
3
- add_filter "/test/"
3
+ add_filter '/test/'
4
4
  end
5
5
 
6
6
  require 'minitest/autorun'
@@ -8,110 +8,110 @@ describe RipperRubyParser::CommentingRipperParser do
8
8
 
9
9
  def empty_params_list
10
10
  @empty_params_list ||= begin
11
- num_params = RUBY_VERSION < "2.0.0" ? 5 : 7
11
+ num_params = RUBY_VERSION < '2.0.0' ? 5 : 7
12
12
  s(:params, *([nil] * num_params))
13
13
  end
14
14
  end
15
15
 
16
- describe "handling comments" do
17
- it "produces a comment node surrounding a commented def" do
16
+ describe 'handling comments' do
17
+ it 'produces a comment node surrounding a commented def' do
18
18
  result = parse_with_builder "# Foo\ndef foo; end"
19
19
  result.must_equal s(:program,
20
20
  s(s(:comment,
21
21
  "# Foo\n",
22
22
  s(:def,
23
- s(:@ident, "foo", s(2, 4)),
23
+ s(:@ident, 'foo', s(2, 4)),
24
24
  empty_params_list,
25
25
  s(:bodystmt, s(s(:void_stmt)), nil, nil, nil)))))
26
26
  end
27
27
 
28
- it "produces a blank comment node surrounding a def that has no comment" do
29
- result = parse_with_builder "def foo; end"
28
+ it 'produces a blank comment node surrounding a def that has no comment' do
29
+ result = parse_with_builder 'def foo; end'
30
30
  result.must_equal s(:program,
31
31
  s(s(:comment,
32
- "",
32
+ '',
33
33
  s(:def,
34
- s(:@ident, "foo", s(1, 4)),
34
+ s(:@ident, 'foo', s(1, 4)),
35
35
  empty_params_list,
36
36
  s(:bodystmt, s(s(:void_stmt)), nil, nil, nil)))))
37
37
  end
38
38
 
39
- it "produces a comment node surrounding a commented class" do
39
+ it 'produces a comment node surrounding a commented class' do
40
40
  result = parse_with_builder "# Foo\nclass Foo; end"
41
41
  result.must_equal s(:program,
42
42
  s(s(:comment,
43
43
  "# Foo\n",
44
44
  s(:class,
45
- s(:const_ref, s(:@const, "Foo", s(2, 6))),
45
+ s(:const_ref, s(:@const, 'Foo', s(2, 6))),
46
46
  nil,
47
47
  s(:bodystmt, s(s(:void_stmt)), nil, nil, nil)))))
48
48
  end
49
49
 
50
- it "produce a blank comment node surrounding a class that has no comment" do
51
- result = parse_with_builder "class Foo; end"
50
+ it 'produce a blank comment node surrounding a class that has no comment' do
51
+ result = parse_with_builder 'class Foo; end'
52
52
  result.must_equal s(:program,
53
53
  s(s(:comment,
54
- "",
54
+ '',
55
55
  s(:class,
56
- s(:const_ref, s(:@const, "Foo", s(1, 6))),
56
+ s(:const_ref, s(:@const, 'Foo', s(1, 6))),
57
57
  nil,
58
58
  s(:bodystmt, s(s(:void_stmt)), nil, nil, nil)))))
59
59
  end
60
60
 
61
- it "produces a comment node surrounding a commented module" do
61
+ it 'produces a comment node surrounding a commented module' do
62
62
  result = parse_with_builder "# Foo\nmodule Foo; end"
63
63
  result.must_equal s(:program,
64
64
  s(s(:comment,
65
65
  "# Foo\n",
66
66
  s(:module,
67
- s(:const_ref, s(:@const, "Foo", s(2, 7))),
67
+ s(:const_ref, s(:@const, 'Foo', s(2, 7))),
68
68
  s(:bodystmt, s(s(:void_stmt)), nil, nil, nil)))))
69
69
  end
70
70
 
71
- it "produces a blank comment node surrounding a module that has no comment" do
72
- result = parse_with_builder "module Foo; end"
71
+ it 'produces a blank comment node surrounding a module that has no comment' do
72
+ result = parse_with_builder 'module Foo; end'
73
73
  result.must_equal s(:program,
74
74
  s(s(:comment,
75
- "",
75
+ '',
76
76
  s(:module,
77
- s(:const_ref, s(:@const, "Foo", s(1, 7))),
77
+ s(:const_ref, s(:@const, 'Foo', s(1, 7))),
78
78
  s(:bodystmt, s(s(:void_stmt)), nil, nil, nil)))))
79
79
  end
80
80
 
81
- it "is not confused by a symbol containing a keyword" do
82
- result = parse_with_builder ":class; def foo; end"
81
+ it 'is not confused by a symbol containing a keyword' do
82
+ result = parse_with_builder ':class; def foo; end'
83
83
  result.must_equal s(:program,
84
- s(s(:symbol_literal, s(:symbol, s(:@kw, "class", s(1, 1)))),
84
+ s(s(:symbol_literal, s(:symbol, s(:@kw, 'class', s(1, 1)))),
85
85
  s(:comment,
86
- "",
86
+ '',
87
87
  s(:def,
88
- s(:@ident, "foo", s(1, 12)),
88
+ s(:@ident, 'foo', s(1, 12)),
89
89
  empty_params_list,
90
90
  s(:bodystmt, s(s(:void_stmt)), nil, nil, nil)))))
91
91
  end
92
92
 
93
- it "is not confused by a dynamic symbol" do
93
+ it 'is not confused by a dynamic symbol' do
94
94
  result = parse_with_builder ":'foo'; def bar; end"
95
95
  result.must_equal s(:program,
96
- s(s(:dyna_symbol, s(s(:@tstring_content, "foo", s(1, 2)))),
96
+ s(s(:dyna_symbol, s(s(:@tstring_content, 'foo', s(1, 2)))),
97
97
  s(:comment,
98
- "",
98
+ '',
99
99
  s(:def,
100
- s(:@ident, "bar", s(1, 12)),
100
+ s(:@ident, 'bar', s(1, 12)),
101
101
  empty_params_list,
102
102
  s(:bodystmt, s(s(:void_stmt)), nil, nil, nil)))))
103
103
  end
104
104
 
105
- it "is not confused by a dynamic symbol containing a class definition" do
105
+ it 'is not confused by a dynamic symbol containing a class definition' do
106
106
  result = parse_with_builder ":\"foo\#{class Bar;end}\""
107
107
  result.must_equal s(:program,
108
108
  s(s(:dyna_symbol,
109
- s(s(:@tstring_content, "foo", s(1, 2)),
109
+ s(s(:@tstring_content, 'foo', s(1, 2)),
110
110
  s(:string_embexpr,
111
111
  s(s(:comment,
112
- "",
112
+ '',
113
113
  s(:class,
114
- s(:const_ref, s(:@const, "Bar", s(1, 13))),
114
+ s(:const_ref, s(:@const, 'Bar', s(1, 13))),
115
115
  nil,
116
116
  s(:bodystmt, s(s(:void_stmt)), nil, nil, nil)))))))))
117
117
  end
@@ -1,25 +1,25 @@
1
1
  require File.expand_path('../test_helper.rb', File.dirname(__FILE__))
2
2
 
3
3
  describe RipperRubyParser::Parser do
4
- describe "#parse" do
5
- describe "for single assignment" do
6
- it "works when assigning to a namespaced constant" do
7
- "Foo::Bar = baz".
4
+ describe '#parse' do
5
+ describe 'for single assignment' do
6
+ it 'works when assigning to a namespaced constant' do
7
+ 'Foo::Bar = baz'.
8
8
  must_be_parsed_as s(:cdecl,
9
9
  s(:colon2, s(:const, :Foo), :Bar),
10
10
  s(:call, nil, :baz))
11
11
  end
12
12
 
13
- it "works when assigning to constant in the root namespace" do
14
- "::Foo = bar".
13
+ it 'works when assigning to constant in the root namespace' do
14
+ '::Foo = bar'.
15
15
  must_be_parsed_as s(:cdecl,
16
16
  s(:colon3, :Foo),
17
17
  s(:call, nil, :bar))
18
18
  end
19
19
 
20
- describe "with a right-hand splat" do
20
+ describe 'with a right-hand splat' do
21
21
  specify do
22
- "foo = *bar".
22
+ 'foo = *bar'.
23
23
  must_be_parsed_as s(:lasgn, :foo,
24
24
  s(:svalue,
25
25
  s(:splat,
@@ -27,7 +27,7 @@ describe RipperRubyParser::Parser do
27
27
  end
28
28
 
29
29
  specify do
30
- "foo = bar, *baz".
30
+ 'foo = bar, *baz'.
31
31
  must_be_parsed_as s(:lasgn, :foo,
32
32
  s(:svalue,
33
33
  s(:array,
@@ -37,9 +37,9 @@ describe RipperRubyParser::Parser do
37
37
  end
38
38
  end
39
39
 
40
- describe "with several items on the right hand side" do
40
+ describe 'with several items on the right hand side' do
41
41
  specify do
42
- "foo = bar, baz".
42
+ 'foo = bar, baz'.
43
43
  must_be_parsed_as s(:lasgn, :foo,
44
44
  s(:svalue,
45
45
  s(:array,
@@ -48,9 +48,9 @@ describe RipperRubyParser::Parser do
48
48
  end
49
49
  end
50
50
 
51
- describe "with an array literal on the right hand side" do
51
+ describe 'with an array literal on the right hand side' do
52
52
  specify do
53
- "foo = [bar, baz]".
53
+ 'foo = [bar, baz]'.
54
54
  must_be_parsed_as s(:lasgn, :foo,
55
55
  s(:array,
56
56
  s(:call, nil, :bar),
@@ -59,16 +59,16 @@ describe RipperRubyParser::Parser do
59
59
  end
60
60
  end
61
61
 
62
- describe "for multiple assignment" do
62
+ describe 'for multiple assignment' do
63
63
  specify do
64
- "foo, * = bar".
64
+ 'foo, * = bar'.
65
65
  must_be_parsed_as s(:masgn,
66
66
  s(:array, s(:lasgn, :foo), s(:splat)),
67
67
  s(:to_ary, s(:call, nil, :bar)))
68
68
  end
69
69
 
70
70
  specify do
71
- "(foo, *bar) = baz".
71
+ '(foo, *bar) = baz'.
72
72
  must_be_parsed_as s(:masgn,
73
73
  s(:array,
74
74
  s(:lasgn, :foo),
@@ -77,7 +77,7 @@ describe RipperRubyParser::Parser do
77
77
  end
78
78
 
79
79
  specify do
80
- "*foo, bar = baz".
80
+ '*foo, bar = baz'.
81
81
  must_be_parsed_as s(:masgn,
82
82
  s(:array,
83
83
  s(:splat, s(:lasgn, :foo)),
@@ -86,9 +86,9 @@ describe RipperRubyParser::Parser do
86
86
  end
87
87
  end
88
88
 
89
- describe "for assignment to a collection element" do
90
- it "handles multiple indices" do
91
- "foo[bar, baz] = qux".
89
+ describe 'for assignment to a collection element' do
90
+ it 'handles multiple indices' do
91
+ 'foo[bar, baz] = qux'.
92
92
  must_be_parsed_as s(:attrasgn,
93
93
  s(:call, nil, :foo),
94
94
  :[]=,
@@ -98,10 +98,10 @@ describe RipperRubyParser::Parser do
98
98
  end
99
99
  end
100
100
 
101
- describe "for operator assignment" do
102
- describe "assigning to a collection element" do
103
- it "handles multiple indices" do
104
- "foo[bar, baz] += qux".
101
+ describe 'for operator assignment' do
102
+ describe 'assigning to a collection element' do
103
+ it 'handles multiple indices' do
104
+ 'foo[bar, baz] += qux'.
105
105
  must_be_parsed_as s(:op_asgn1,
106
106
  s(:call, nil, :foo),
107
107
  s(:arglist,
@@ -111,24 +111,24 @@ describe RipperRubyParser::Parser do
111
111
  s(:call, nil, :qux))
112
112
  end
113
113
 
114
- it "works with &&=" do
115
- "foo &&= bar".
114
+ it 'works with &&=' do
115
+ 'foo &&= bar'.
116
116
  must_be_parsed_as s(:op_asgn_and,
117
117
  s(:lvar, :foo), s(:lasgn, :foo, s(:call, nil, :bar)))
118
118
  end
119
119
  end
120
120
  end
121
121
 
122
- describe "for multiple assignment" do
123
- describe "with a right-hand splat" do
122
+ describe 'for multiple assignment' do
123
+ describe 'with a right-hand splat' do
124
124
  specify do
125
- "foo, bar = *baz".
125
+ 'foo, bar = *baz'.
126
126
  must_be_parsed_as s(:masgn,
127
127
  s(:array, s(:lasgn, :foo), s(:lasgn, :bar)),
128
128
  s(:splat, s(:call, nil, :baz)))
129
129
  end
130
130
  specify do
131
- "foo, bar = baz, *qux".
131
+ 'foo, bar = baz, *qux'.
132
132
  must_be_parsed_as s(:masgn,
133
133
  s(:array, s(:lasgn, :foo), s(:lasgn, :bar)),
134
134
  s(:array,