diff --git a/presentation/01_intro.slides b/presentation/01_intro.slides index 79f6901..244482c 100644 --- a/presentation/01_intro.slides +++ b/presentation/01_intro.slides @@ -52,13 +52,13 @@ end onmouseout="this.src='normal.gif'" /> ``` -!SLIDE larger +!SLIDE ``` html ``` diff --git a/presentation/02_follow_along.slides b/presentation/02_follow_along.slides index f9ee32d..e0ad786 100644 --- a/presentation/02_follow_along.slides +++ b/presentation/02_follow_along.slides @@ -2,7 +2,7 @@ # Follow along! !SLIDE -# [johnbintz.github.com/tea-time](http://johnbintz.github.com/tea-time/) +## [johnbintz.github.com/tea-time](http://johnbintz.github.com/tea-time/) !SLIDE # No need to install anything right now diff --git a/presentation/03_describe_and_it.slides b/presentation/03_describe_and_it.slides index 1b4aea4..14b9e7a 100644 --- a/presentation/03_describe_and_it.slides +++ b/presentation/03_describe_and_it.slides @@ -22,7 +22,7 @@ describe 'Cat', -> !SLIDE image-80-percent -!SLIDE even-larger +!SLIDE larger ``` coffeescript describe 'Cat', -> describe '#meow', -> diff --git a/presentation/04_expect.slides b/presentation/04_expect.slides index 3040eb1..26d1f36 100644 --- a/presentation/04_expect.slides +++ b/presentation/04_expect.slides @@ -33,7 +33,7 @@ class this.Cat meow: -> ``` -!SLIDE even-larger +!SLIDE larger ``` javascript // safety wrapper to prevent global pollution (function() { diff --git a/presentation/05_meow_states.slides b/presentation/05_meow_states.slides index 851095d..2949390 100644 --- a/presentation/05_meow_states.slides +++ b/presentation/05_meow_states.slides @@ -15,10 +15,12 @@ describe 'Cat', -> describe '#meow', -> describe 'hungry', -> - # Cat#meow expectation for when the cat is hungry + # Cat#meow expectation for when + # the cat is hungry describe 'going to the vet', -> - # Cat#meow expectation for when the cat knows it's vet time + # Cat#meow expectation for when + # the cat knows it's vet time ``` !SLIDE larger @@ -28,14 +30,16 @@ describe 'Cat', -> describe 'hungry', -> it 'should be a mournful meow', -> cat = new Cat() - cat.state = -> Cat.HUNGRY # ...just like cat.stubs(:state) + cat.state = -> Cat.HUNGRY + # ...just like cat.stubs(:state) expect(cat.meow()).toEqual("meeeyaow") describe 'going to the vet', -> it 'should be an evil meow', -> cat = new Cat() - cat.state = -> Cat.VET_PSYCHIC # ...just like the one above + cat.state = -> Cat.VET_PSYCHIC + # ...just like the one above expect(cat.meow()).toEqual("raowwww") ``` @@ -72,7 +76,7 @@ before do @instance_variable = "yes" end -it "should be in the same context as the before block" do +it "is in same context as before block" do @instance_variable.should == "yes" end ``` diff --git a/presentation/07_matchers.slides b/presentation/07_matchers.slides index a6e27d5..f6cb768 100644 --- a/presentation/07_matchers.slides +++ b/presentation/07_matchers.slides @@ -5,7 +5,8 @@ ``` ruby cat.meow.should == "meow" cat.should be_a_kind_of(Cat) -cat.should_not be_hungry #=> cat.hungry?.should == false +cat.should_not be_hungry + # => cat.hungry?.should == false ``` !SLIDE even-larger diff --git a/presentation/08_mocks_and_stubs.slides b/presentation/08_mocks_and_stubs.slides index 7c19fc1..7504f8e 100644 --- a/presentation/08_mocks_and_stubs.slides +++ b/presentation/08_mocks_and_stubs.slides @@ -36,7 +36,7 @@ describe 'John', -> !SLIDE image-80-percent -!SLIDE even-larger +!SLIDE larger ``` gherkin Feature: Cat Behaviors Scenario: Hungry cats meow a particular way @@ -64,7 +64,7 @@ class this.Cat Cat.HUNGRY ``` -!SLIDE even-larger +!SLIDE larger ``` coffeescript describe 'Cat', -> describe '#meow', -> @@ -93,8 +93,9 @@ class this.Cat !SLIDE larger ``` coffeescript -cat.foodLevel = 15 # do we care about food level in this test? - # all we care about is that the cat is hungry +cat.foodLevel = 15 + # do we care about food level in this test? + # all we care about is that the cat is hungry ``` !SLIDE larger @@ -104,8 +105,9 @@ describe 'Cat', -> describe 'hungry', -> it 'should be a mournful meow', -> cat = new Cat() - cat.state = -> Cat.HUNGRY # <= we don't care how state works, - # we just want a hungry cat + cat.state = -> Cat.HUNGRY + # ^^^ we don't care how state works, + # we just want a hungry cat expect(cat.meow()).toEqual("meeeyaow") ``` @@ -154,7 +156,7 @@ class this.Cat this.modifyForGround(speech) ``` -!SLIDE larger +!SLIDE ``` coffeescript describe 'Cat#vocalProcessor', -> speech = "speech" @@ -185,23 +187,23 @@ spyOn(@cat, 'modifyForAirborne') !SLIDE # Two basic ways to make sure a spy is called -!SLIDE even-larger -# `toHaveBeenCalledWith()` -## Called least once with the given parameters +!SLIDE +## `toHaveBeenCalledWith(args...)` +### Called least once with the given parameters ``` coffeescript expect(@cat.modifyForAirborne).toHaveBeenCalledWith(speech) ``` -!SLIDE even-larger -# `toHaveBeenCalled()` -# Just called, no parameter check +!SLIDE +## `toHaveBeenCalled()` +### Just called, no parameter check ``` coffeescript expect(@cat.modifyForAirborne).toHaveBeenCalled() ``` -!SLIDE even-larger +!SLIDE larger # Instance Mocks/Spies in JavaScript ## Use `spyOn`/`toHaveBeenCalled` matchers @@ -218,7 +220,7 @@ expect(cat.state).toHaveBeenCalled() !SLIDE # `spyOn` works great with class-level stubs and mocks, too -!SLIDE even-larger +!SLIDE ``` coffeescript class this.Cat @generateFurColor: (base) -> @@ -229,13 +231,13 @@ class this.Cat follicle.regrow(Cat.generateFurColor(this.baseColor)) ``` -!SLIDE even-larger +!SLIDE larger ``` coffeescript Cat.generateFurColor = -> "whoops i nuked this method for every other test" ``` -!SLIDE larger +!SLIDE ``` coffeescript describe 'Cat#regrowFur', -> color = 'color' @@ -257,7 +259,7 @@ describe 'Cat#regrowFur', -> expect(@follicle.regrow).toHaveBeenCalledWith(color) ``` -!SLIDE even-larger +!SLIDE larger # Class Stubs in JavaScript ## Use `spyOn` to generate stubs so that the original code is replaced after the test @@ -327,7 +329,7 @@ describe 'Cat#fetch', -> !SLIDE # Sometimes you just need a big blob of unit tests -!SLIDE even-larger +!SLIDE ``` coffeescript # fast and focused! @@ -341,7 +343,7 @@ describe 'Cat#respondsTo', -> expect(@cat.respondsTo(request)).toBeTruthy() ``` -!SLIDE even-larger +!SLIDE larger ``` gherkin # slow and synergistic! diff --git a/presentation/09_using_in_your_project.slides b/presentation/09_using_in_your_project.slides index 6b99315..0606aea 100644 --- a/presentation/09_using_in_your_project.slides +++ b/presentation/09_using_in_your_project.slides @@ -2,7 +2,7 @@ # Using it in your project !SLIDE -# [github.com/pivotal/jasmine-gem](http://github.com/pivotal/jasmine-gem) +## [github.com/pivotal/jasmine-gem](http://github.com/pivotal/jasmine-gem) !SLIDE # Starts a Rack server for running Jasmine against your code diff --git a/presentation/10_misc_hints.slides b/presentation/10_misc_hints.slides index a9dcdd9..e9d20d2 100644 --- a/presentation/10_misc_hints.slides +++ b/presentation/10_misc_hints.slides @@ -7,13 +7,13 @@ !SLIDE # Mocking and stubbing `$.fn` calls -!SLIDE larger +!SLIDE ``` coffeescript this.containerWaiter = -> $('#container').addClass('wait').append('
') ``` -!SLIDE even-larger +!SLIDE ``` coffeescript $.fn.makeWait = -> $(this).addClass('wait').append('
') @@ -29,7 +29,7 @@ this.containerWaiter = -> !SLIDE # `jquery-jasmine` -!SLIDE even-larger +!SLIDE larger ``` coffeescript describe 'container', -> beforeEach -> @@ -148,38 +148,7 @@ _.mixin(CatLike) _.catify("john") # => "meow meow john" ``` -!SLIDE even-larger -``` coffeescript -CatLike = - catify: (name) -> "meow meow #{name}" - -class Cat - hiss: -> "hiss" - -# like Ruby include, add code to instances -for method, code of CatLike - Cat.prototype[method] = code - -cat = new Cat() -cat.catify("john") # => "meow meow #{name}" -``` - -!SLIDE even-larger -``` coffeescript -CatLike = - catify: (name) -> "meow meow #{name}" - -class Cat - hiss: -> "hiss" - -# like Ruby extend, add code to class -for method, code of CatLike - Cat[method] = code - -Cat.catify("john") # => "meow meow john" -``` - -!SLIDE even-larger +!SLIDE larger ``` coffeescript describe '_.catify', -> it 'should catify', -> @@ -189,7 +158,7 @@ describe '_.catify', -> !SLIDE # Eliminate the Underscore.js dependency -!SLIDE even-larger +!SLIDE ``` coffeescript describe 'CatLike', -> beforeEach -> diff --git a/presentation/11_conclusion.slides b/presentation/11_conclusion.slides index bf553e1..c0fad94 100644 --- a/presentation/11_conclusion.slides +++ b/presentation/11_conclusion.slides @@ -35,10 +35,10 @@ runs() ``` !SLIDE -# [Jasmine documentation](http://pivotal.github.com/jasmine/) +## [Jasmine documentation](http://pivotal.github.com/jasmine/) !SLIDE -# [johnbintz.github.com/tea-time](http://johnbintz.github.com/tea-time/) +## [johnbintz.github.com/tea-time](http://johnbintz.github.com/tea-time/) !SLIDE # Any questions?