Skip to content

Commit 34ff9de

Browse files
committed
fixed config of parser gem
1 parent 103ccb9 commit 34ff9de

File tree

3 files changed

+6
-11
lines changed

3 files changed

+6
-11
lines changed

ruby/hyper-model/spec/batch1/column_types/column_type_spec.rb

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -239,21 +239,11 @@ class DefaultTest < ActiveRecord::Base
239239
end
240240

241241
it 'converts a 0, "false" false and nil to a boolean false, everything else is true' do
242-
# there is a bug someplace (unparser probably) that is is treating the empty array as nil
243-
# but ONLY if it is the normal ruby block (not a string) AND if you use a normal arg
244-
# instead of *args. In other words put that same expression in a string and change
245-
# *args/args.first to plain old arg and it works fine.
246242
expect_evaluate_ruby do
247-
[0, 'false', false, nil, 'hi', 17, [], true].collect do |*args|
248-
TypeTest.new(boolean: args.first).boolean
249-
end
250-
end.to eq([false, false, false, false, true, true, true, true])
251-
252-
expect_evaluate_ruby("
253243
[0, 'false', false, nil, 'hi', 17, [], true].collect do |val|
254244
TypeTest.new(boolean: val).boolean
255245
end
256-
").to eq([false, false, false, false, true, true, true, true])
246+
end.to eq([false, false, false, false, true, true, true, true])
257247
check_errors
258248
end
259249

ruby/hyper-model/spec/support/component_helpers.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
require 'parser/current'
44
require 'unparser'
5+
6+
Parser::Builders::Default.emit_procarg0 = true
7+
58
#require 'pry'
69

710
module ComponentTestHelpers

ruby/hyper-spec/lib/hyper-spec/component_test_helpers.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
require 'method_source'
66
require_relative '../../lib/hyper-spec/time_cop.rb'
77

8+
Parser::Builders::Default.emit_procarg0 = true
9+
810
module HyperSpec
911
module ComponentTestHelpers
1012
TOP_LEVEL_COMPONENT_PATCH =

0 commit comments

Comments
 (0)