Skip to content

Instantly share code, notes, and snippets.

View codetombomb's full-sized avatar
:octocat:

Tom Tobar codetombomb

:octocat:
View GitHub Profile
expect(1<2).to be true
#what is really happening here is this:
expect(1<2).to(be(true))
@codetombomb
codetombomb / expectations_examples.rb
Created August 29, 2020 22:16
Expectation Basic Structure
#We expect a thing that we set to match an outcome
expect(something).to matcher(outcome)
#We expect a thing that we set not to match an outcome
expect(something).not_to matcher(outcome)
@codetombomb
codetombomb / cat_spec.rb
Last active August 29, 2020 21:53
Initializing Cat instance with string name
require 'cat'
describe Cat do
it "is initialized with a name" do
cat = Cat.new("Wednesday")
expect(cat.name).to eq("Wednesday")
end
end
@codetombomb
codetombomb / cat_spec.rb
Last active August 29, 2020 21:17
Alternate describe view
require "cat"
Rspec.describe("Cat"){ #examples }