Skip to content

Commit 3dff058

Browse files
committed
Upgrade to Ruby 3.4 & Fix broken tests for Ruby 3.4+
1 parent 8d517e8 commit 3dff058

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ruby-3.2.2
1+
ruby-3.4.2

spec/fixtures/glimmer/dsl/element.rb

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,19 @@ def children
1717
def to_s
1818
output = @name.to_s
1919
if @args && !@args.to_a.empty?
20-
output += "(#{@args.to_a.map(&:to_s).join})"
20+
output_args = @args.to_a.map do |element|
21+
if element.is_a?(Hash)
22+
element_output = element.reduce('') do |output, key_value_pair|
23+
key, value = key_value_pair
24+
output = "#{output}, " unless output.empty?
25+
"#{output}#{key}: \"#{value}\""
26+
end
27+
"{#{element_output}}"
28+
else
29+
element.to_s
30+
end
31+
end.join
32+
output += "(#{output_args})"
2133
end
2234
if !children.empty?
2335
output += " { "

spec/lib/glimmer/dsl/engine_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ module GlimmerSpec
5757
}
5858
}
5959

60-
expect(@target.to_s).to eq('SWT shell { SWT Dynamic browser(XML html { XML Dynamic body { XML Dynamic input({:type=>"text", :value=>"Hello, World!"}) } }) }')
61-
expect(GLIMMER_TOP_LEVEL_TARGET.to_s).to eq('SWT shell { SWT Dynamic browser(XML html { XML Dynamic body { XML Dynamic input({:type=>"text", :value=>"Hello, World!"}) } }) }')
60+
expect(@target.to_s).to eq('SWT shell { SWT Dynamic browser(XML html { XML Dynamic body { XML Dynamic input({type: "text", value: "Hello, World!"}) } }) }')
61+
expect(GLIMMER_TOP_LEVEL_TARGET.to_s).to eq('SWT shell { SWT Dynamic browser(XML html { XML Dynamic body { XML Dynamic input({type: "text", value: "Hello, World!"}) } }) }')
6262
end
6363

6464
it 'interprets another expression hierarchy in the middle of interpreting an expression hierarchy' do
@@ -217,7 +217,7 @@ module GlimmerSpec
217217
}
218218
}
219219

220-
expect(@target.to_s).to eq('SWT shell { SWT Dynamic browser(XML html { XML Dynamic body { XML Dynamic input({:type=>"text", :value=>"Hello, World!"}) } }) }')
220+
expect(@target.to_s).to eq('SWT shell { SWT Dynamic browser(XML html { XML Dynamic body { XML Dynamic input({type: "text", value: "Hello, World!"}) } }) }')
221221
end
222222

223223
it 'enables specified DSLs only' do

0 commit comments

Comments
 (0)