let variables
let variables can change
subject/let variables resets between each example
put conditional information in the 'context' string
implicitly defined 'subject'
note on explicit 'subject'
one-lines syntax
predicate matchers
explicit 'subject'
comparison matchers
.not_to instead of .to
(assignment has 'include')
true/false
include
truthy and falsy
(no assignment)
eq & eql & equal & be
all matcher
contain_exactly matcher
start_with
end_with
more compound examples
using .or with compound expectations
change matcher (syntax can be too tightly coupled to the subject)
custom matcher
default parameters
magic_matchers
described class
shared examples
have_attributes
respond_to
Arrange, Act & Assert testing pattern
disabling rubocop
Important to write small, isolated methods to test
Unnecessary to test puts and gets
Use 'gets methods' as parameters in another method that is tested
stubbing a method
creating new subjects & variables with meaningful names
before hooks
message expectations
output matcher
TDD with doubles
Red-Green-Refactor
Creating a test subject, with a double as an argument
Add method names to: subject { described_class.new.solution }
Changing TDD Double to Instance Double
Determining what methods need to be tested in unit testing
instance_variable_get
Class Encapsulation
Polymorphism concept
modules
not_to raise_error
testing rescued error
be_within matcher
cover matcher
throw_symbol matcher
yield matcher
shared_context
custom error message - expect(card.suit).to eq(comparison), Expected #{comparison}, not #{card.suit}."
spies