test_spec.rb:(從FakeFS example)爲什麼FakeFS會破壞RSpec?
require 'fakefs/spec_helpers'
describe 'Test' do
include FakeFS::SpecHelpers
it 'should fail' do
expect(1).to eq(2)
end
end
describe 'Test2' do
it 'should fail' do
expect(1).to eq(2)
end
end
rspec的規格/ test_spec.rb返回superclass mismatch for class File
用於第一測試和正常expected: 2 got: 1
在第二種情況下。匹配更改(例如be_kind_of(String)
)不會影響結果。爲什麼會發生這種情況?如何解決?
紅寶石-v
ruby 2.4.0dev (2016-03-19 trunk 54188) [x86_64-linux]
見:https://github.com/fakefs/fakefs/issues/215 – lifetimes