Blog

Posts by Lloyd Dewolf

03 Jul 2009, 05:18
3751204a1a48ba86eb6bb83a96640318_pragsmall

Lloyd Dewolf (6 posts)

(from PragPub > Subscribe)

This is also the info I was looking for.

09 Dec 2010, 07:20
3751204a1a48ba86eb6bb83a96640318_pragsmall

Lloyd Dewolf (6 posts)

(from The RSpec Book > codebreaker vs code-breaker)

As I’ve been trying to follow the advice about roles it strikes me as a little awkward that the role used early in the book is code-breaker and the name of the application is codebreaker.

When I recently got to 4.1, it wasn’t clear to me the reasoning behind the name ‘codebreaker_steps.rb’. I don’t know if that reflects the name of the app or the role, or why, whereas it seems there were specific features, the steps look to be thrown in one bucket.

(Really enjoying the book so far.)

09 Dec 2010, 08:04
3751204a1a48ba86eb6bb83a96640318_pragsmall

Lloyd Dewolf (6 posts)

(from The RSpec Book > Given I'm the 1st Feature)

I find I learn well if I go on my own while working through exercises.

I came up with:

$ cucumber 
Feature: time-traveler indicates start recording
  
  As a time-traveler
  I want to mark the start of timing
  So that I can later mark the end of timing when I'm done

  Scenario: recording not yet started                    # features/timetraveler_indicates_start_recording.feature:7
    Given I am not yet recording time                    # features/timetraveler_indicates_start_recording.feature:8
    When I indicate to mark the start of recording       # features/timetraveler_indicates_start_recording.feature:9
    Then the status should be "recording"                # features/timetraveler_indicates_start_recording.feature:10
    And the time I started the started recording stored. # features/timetraveler_indicates_start_recording.feature:11

Feature: time-traveler starts tracker
  
  As a time-traveler
  I want to to start the tracker
  So that I can record time

  Scenario: start tracker                     # features/timetraveler_starts_tracker.feature:7
    Given I am not yet recording time         # features/timetraveler_starts_tracker.feature:8
    When I start the tracker                  # features/timetraveler_starts_tracker.feature:9
    Then I should see "Welcome to Know Time!" # features/timetraveler_starts_tracker.feature:10
    And I should see "Start recording? (y/n)" # features/timetraveler_starts_tracker.feature:11

2 scenarios (2 undefined)
8 steps (8 undefined)
0m0.006s

...

So, of course, I’m bothered by it being in reference order (running in file alphabetic order) … but I accept that I’m early in the book.

I’m already finding pain because of the fluid fun of English with “record”, “recording”, etc

So I have the same Given for both… I think the 1st feature in the book tripped me up: “Given I am not yet playing”. Now I think I was trying to hard, and should just go with “Given the app isn’t running”

09 Dec 2010, 19:21
3751204a1a48ba86eb6bb83a96640318_pragsmall

Lloyd Dewolf (6 posts)

(from The RSpec Book > 8.4 Exploratory Testing: "outside the scope of this book")

bq. It has a rich history and is a deep craft in its own right, the breadth of which is outside the scope of this book. For our purposes, we want you to simply fire up the Codebreaker game and enter guesses and analyze the outcomes.

I cringe whenever I read “{outside,beyond} the scope of this book”.

Seems like a missed opportunity to at least provide a footnote with recommended resources.

09 Dec 2010, 23:32
3751204a1a48ba86eb6bb83a96640318_pragsmall

Lloyd Dewolf (6 posts)

(from The RSpec Book > step_definition ordering)

6.1 Scenario Outlines in Cucumber

bq. Copy the first snippet into features/step_definitions/codebreaker_steps.rb, and modify it as follows:

Given /^the secret code is "([^"]*)"$/ do |secret|
  game = Codebreaker::Game.new(output)
  game.start(secret)
end

</code>

The ordering in cb/16/features/step_definitions/codebreaker_steps.rb seems illogical:

Given /^I am not yet playing$/ do
end

Given /^the secret code is "([^"]*)"$/ do |secret|
  game = Codebreaker::Game.new(output)
  game.start(secret)
end

When /^I start a new game$/ do
  game = Codebreaker::Game.new(output)
  game.start
end

Then /^I should see "([^"]*)"$/ do |message|
  output.messages.should include(message)
end

But I can’t think of a more logical placement. Is the general to add as the last item in it’s keyword. In this case Given.

10 Dec 2010, 00:25
3751204a1a48ba86eb6bb83a96640318_pragsmall

Lloyd Dewolf (6 posts)

(from The RSpec Book > Name discrepancy)

I think code-breaker refers to the user in her role as the player of the game codebreaker. I also found this confusing http://forums.pragprog.com/forums/95/topics/8201

6 posts