Skip to content

Commit

Permalink
fix unreached code
Browse files Browse the repository at this point in the history
  • Loading branch information
taichi-ishitani committed Mar 26, 2024
1 parent 82d5531 commit 8220db1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
6 changes: 1 addition & 5 deletions lib/rupkl/node/pkl_object.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@ def evaluate_property(value, objects, scopes)
end

def property_to_ruby(value, objects, scopes)
if value
value.to_ruby(scopes)
else
evaluate_objects(objects, scopes).to_ruby(nil)
end
evaluate_property(value, objects, scopes).to_ruby(nil)
end

def evaluate_objects(objects, scopes)
Expand Down
8 changes: 4 additions & 4 deletions spec/rupkl/node/pkl_object_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -427,15 +427,15 @@
#{pkl}
c = a == b
PKL
node.evaluate(nil) do |n|
node.evaluate(nil).then do |n|
expect(n.properties[-1].value).to be_boolean(true)
end

node = parser.parse(<<~PKL, root: :pkl_module)
#{pkl}
c = a != b
PKL
node.evaluate(nil) do |n|
node.evaluate(nil).then do |n|
expect(n.properties[-1].value).to be_boolean(false)
end
end
Expand All @@ -445,15 +445,15 @@
#{pkl}
c = a == b
PKL
node.evaluate(nil) do |n|
node.evaluate(nil).then do |n|
expect(n.properties[-1].value).to be_boolean(false)
end

node = parser.parse(<<~PKL, root: :pkl_module)
#{pkl}
c = a != b
PKL
node.evaluate(nil) do |n|
node.evaluate(nil).then do |n|
expect(n.properties[-1].value).to be_boolean(true)
end
end
Expand Down

0 comments on commit 8220db1

Please sign in to comment.