Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
require 'yaml'
class X
def self.y
YAML.load_file("abc")
end
end
RSpec.describe X do
it 'works' do
allow(YAML).to receive(:load_file).and_return("loaded data")
expect(X.y).to eq("loaded data")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment