This is my production code
def my_method
list = [.....]
list.each do |filename|
content = File.read(filename)
...
end
end
I am writing an unit test in Rspec, so how to mock the File.read using wildcard parameter?
File.should_receive(:read).with(??some regex here).and_return ""
Thanks in advance!
You can use anything
or any_args
.
File.should_receive(:read).with(anything).and_return ""