File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change 1
1
require_relative '../../spec_helper'
2
2
3
-
4
3
ruby_version_is "3.2" do
5
4
describe "SyntaxError#path" do
6
5
it "returns the file path provided to eval" do
7
- expected = 'speccing.rb'
6
+ filename = "speccing.rb"
7
+
8
8
-> {
9
- eval ( ' if true' , TOPLEVEL_BINDING , expected )
9
+ eval ( " if true" , TOPLEVEL_BINDING , filename )
10
10
} . should raise_error ( SyntaxError ) { |e |
11
- e . path . should == expected
11
+ e . path . should == filename
12
12
}
13
13
end
14
14
15
15
it "returns the file path that raised an exception" do
16
- expected_path = fixture ( __FILE__ , 'syntax_error.rb' )
16
+ expected_path = fixture ( __FILE__ , "syntax_error.rb" )
17
+
17
18
-> {
18
- require_relative ' fixtures/syntax_error'
19
- } . should raise_error ( SyntaxError ) { |e | e . path . should == expected_path }
19
+ require_relative " fixtures/syntax_error"
20
+ } . should raise_error ( SyntaxError ) { |e | e . path . should == expected_path }
20
21
end
21
22
22
23
it "returns nil when constructed directly" do
You can’t perform that action at this time.
0 commit comments