Expectations on FileUtils aren't reverted on Ruby 1.8.7
Created by: segiddins
The following test suite passes on Ruby 2.4 but fails on 1.8.7
require "rspec"
require "fileutils"
RSpec.describe "dss" do
it "foo" do
expect(FileUtils).to receive(:mkpath).once
FileUtils.mkpath "a"
end
it "bar" do
expect(FileUtils.mkpath Dir.pwd).to eq([Dir.pwd])
end
end
with the following output
.F
Failures:
1) dss bar
Failure/Error: expect(FileUtils.mkpath Dir.pwd).to eq([Dir.pwd])
NoMethodError:
undefined method `mkpath' for FileUtils:Module
# ./foo_spec.rb:11
Finished in 0.00868 seconds (files took 0.21881 seconds to load)
2 examples, 1 failure
Failed examples:
rspec ./foo_spec.rb:10 # dss bar