Skip to content

Commit

Permalink
Fix formatting and style in specs
Browse files Browse the repository at this point in the history
  • Loading branch information
andrykonchin committed Mar 29, 2024
1 parent 4303919 commit 632adc5
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions core/exception/syntax_error_spec.rb
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
require_relative '../../spec_helper'


ruby_version_is "3.2" do
describe "SyntaxError#path" do
it "returns the file path provided to eval" do
expected = 'speccing.rb'
filename = "speccing.rb"

-> {
eval('if true', TOPLEVEL_BINDING, expected)
eval("if true", TOPLEVEL_BINDING, filename)
}.should raise_error(SyntaxError) { |e|
e.path.should == expected
e.path.should == filename
}
end

it "returns the file path that raised an exception" do
expected_path = fixture(__FILE__, 'syntax_error.rb')
expected_path = fixture(__FILE__, "syntax_error.rb")

-> {
require_relative 'fixtures/syntax_error'
}.should raise_error(SyntaxError) {|e| e.path.should == expected_path }
require_relative "fixtures/syntax_error"
}.should raise_error(SyntaxError) { |e| e.path.should == expected_path }
end

it "returns nil when constructed directly" do
Expand Down

0 comments on commit 632adc5

Please sign in to comment.