This repository was archived by the owner on Nov 30, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed
features/step_definitions Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 98
98
end
99
99
100
100
Given /^I have a brand new project with no files$/ do
101
- in_current_dir do
101
+ cd ( '.' ) do
102
102
expect ( Dir [ "**/*" ] ) . to eq ( [ ] )
103
103
end
104
104
end
115
115
end
116
116
117
117
When "I accept the recommended settings by removing `=begin` and `=end` from `spec/spec_helper.rb`" do
118
- in_current_dir do
118
+ cd ( '.' ) do
119
119
spec_helper = File . read ( "spec/spec_helper.rb" )
120
120
expect ( spec_helper ) . to include ( "=begin" , "=end" )
121
121
138
138
end
139
139
140
140
When ( /^I fix "(.*?)" by replacing "(.*?)" with "(.*?)"$/ ) do |file_name , original , replacement |
141
- in_current_dir do
141
+ cd ( '.' ) do
142
142
contents = File . read ( file_name )
143
143
expect ( contents ) . to include ( original )
144
144
fixed = contents . sub ( original , replacement )
151
151
end
152
152
153
153
Given ( /^I have not configured `example_status_persistence_file_path`$/ ) do
154
- in_current_dir do
154
+ cd ( '.' ) do
155
155
return unless File . exist? ( "spec/spec_helper.rb" )
156
156
return unless File . read ( "spec/spec_helper.rb" ) . include? ( "example_status_persistence_file_path" )
157
157
File . open ( "spec/spec_helper.rb" , "w" ) { |f | f . write ( "" ) }
230
230
end
231
231
232
232
Given ( /^I have changed `([^`]+)` to `([^`]+)` in "(.*?)"$/ ) do |old_code , new_code , file_name |
233
- in_current_dir do
233
+ cd ( '.' ) do
234
234
file_content = File . read ( file_name )
235
235
expect ( file_content ) . to include ( old_code )
236
236
new_file_content = file_content . sub ( old_code , new_code )
Original file line number Diff line number Diff line change @@ -66,6 +66,11 @@ def handle_current_dir_change
66
66
ensure
67
67
RSpec ::Core ::Metadata . instance_variable_set ( :@relative_path_regex , nil )
68
68
end
69
+
70
+ def in_current_directory ( &block )
71
+ # Arbua deprecated this helper but we use it all over the place
72
+ cd ( '.' , &block )
73
+ end
69
74
end
70
75
71
76
RSpec . configure do |c |
You can’t perform that action at this time.
0 commit comments