Skip to content

Instantly share code, notes, and snippets.

/object_spec.rb Secret

Created August 18, 2017 11:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/b7a96016e31d5674cf43dffcf15ca35b to your computer and use it in GitHub Desktop.
Save anonymous/b7a96016e31d5674cf43dffcf15ca35b to your computer and use it in GitHub Desktop.
object_spec.rb
describe "#method" do
subject { build(:object) }
before do
allow(subject).to receive(:method1)
allow(subject).to receive(:method2)
allow(subject).to receive(:method3)
allow(subject).to receive(:method4)
end
it "calls method1" do
expect(subject).to receive(:method1)
subject.method
end
it "calls method2" do
expect(subject).to receive(:method2)
subject.method
end
it "calls method3" do
expect(subject).to receive(:method3)
subject.method
end
it "calls method4" do
expect(subject).to receive(:method4)
subject.method
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment