We try to keep our books accurate, but sometimes mistakes creep
in. This page lists the errors submitted by our astute readers.
If you've found a new error, please
submit it.
The latest version of the book is B13.0,
released 20 days ago.
If you've bought a PDF of the book and would like to upgrade
it to this version (for free), visit your
home page.
| PDF |
Paper |
Description |
Found in |
Fixed in |
| C |
|
#42203: This seems to be a snippet from the original (b.12) codebreaker example.--Sean P. DeNigris
|
B13.0
28-Jan-10
|
|
| 0 |
|
#38571: It's hard to follow the provided code examples, in the sequence of numbered folders.
How about a git repo for each of the main projects that book takes the reader through. Each step could have its own commit, and the reader could view it on github or clone it to their local machine and use tools like gitx to view it or play with it.--Charlie O'Keefe #38571: It's hard to follow the provided code examples, in the sequence of numbered folders.
How about a git repo for each of the main projects tha ...more...
David Chelimsky says: That's actually in the plan Charlie, but not until the final release.
|
B3.0
27-Mar-09
|
|
| 20 |
|
#42181: _Getting the words right_
"We believe that most of the problems that software development teams face are communication problems, and so are the rest."
The rest of what???--Robert Winter #42181: _Getting the words right_
"We believe that most of the problems that software development teams face are communication problems, and so are ...more...
David Chelimsky says: The rest of the problems! (it's a bit tongue in cheek)
|
B13.0
25-Jan-10
|
|
| 21 |
|
#41850: When viewing the PDF using Adobe 9.2.0 on Windows XP the equals signs within the code sample appear instead as what look to be bolded dashes. When I copy and paste the code sample into emacs the code appears correctly with the equals sign:
describe MovieList do
context "when first created" do
it "should be empty" do
movie_list = MovieList.new
movie_list.should be_empty
end
end
end
Therefore this issue only appears when viewing sample code within the Adobe PDF viewer but copy and paste into another program renders the sample code correctly. This issue is not unique to page #21 of the PDF but it is the first instance I noted it.
I can provide a screenshot of the error if desired.
Asa
bourea@hotmail.com--Asa Bour #41850: When viewing the PDF using Adobe 9.2.0 on Windows XP the equals signs within the code sample appear instead as what look to be bolded dashes. ...more...
|
B12.0
17-Dec-09
|
|
| 22 |
|
#37358: More syntax highlighting in the plain text scenarios.--bartz
|
B1.0
30-Jan-09
|
|
| 27 |
|
#37568: There is further project structure confusion on page 27. Unlike Unix, Windows itself does not commonly have a bin directory, although Ruby does have a bin directory. Perhaps the authors are assuming that the student created the mastermind directory under the Ruby directory? Is so, suggesting it, because the project tree diagram in figure 2.2 doesn’t imply a bin anywhere. Also while Unix uses forward slashes at the command line, Windows uses back slashes, so the correct Windows format might be:
C:\ruby\bin\mastermind.bat
assuming that is what the authors intended.
--Camille Bell #37568: There is further project structure confusion on page 27. Unlike Unix, Windows itself does not commonly have a bin directory, although Ruby doe ...more...
|
B1.0
06-Feb-09
|
|
| 29 |
|
#42182: _Hello Cucumber_
[...]add two directories named features and spec, and move the greeter_spec.rb file from the RSpec example into the hello/spec directory.
I have a big problem with this sentence, because it leads one to falsely believe that hello/spec/greeter_spec.rb is somehow necessary for the Hello Cucumber example. It took me several reads to realize it is not necessary.
You can rework the text on page 32 to include creating the spec directory and moving the file. Then you can demonstrate how one has both Cucumber and RSpec working examples in a shared directory structure.--Robert Winter #42182: _Hello Cucumber_
[...]add two directories named features and spec, and move the greeter_spec.rb file from the RSpec example into the hello/sp ...more...
|
B13.0
25-Jan-10
|
|
|
31 |
#40301: "Iteration" not explained
The term “iteration” is used very early on (first reference is p31 in b8_0) but not explained. There’s even an entire section titled “Planning the First Iteration” slightly later on but there’s still no explanation what this means in that section. Much later (p145) there’s a very brief reference to an iteration being an one or two week “mini-project” but no detailed explanation.
I think it would help to explain up front, at least briefly, what an iteration (and other Agile terms used in the book) is for those not familiar with Agile development methodologies rather than waiting till later like in Chap 10.
--Michael Wang #40301: "Iteration" not explained
The term “iteration” is used very early on (first reference is p31 in b8_0) but not explained. There’s even an en ...more...
|
B8.0
01-Aug-09
|
|
| 33 |
|
#41504: I would like more information on the higher-level project descriptions i.e. outcomes and feature sets, and how they fit in. Specifically, I want to know how they would fit in with the codebreaker example - what are the feature sets for it? Would there be outcomes?--Sean P. DeNigris #41504: I would like more information on the higher-level project descriptions i.e. outcomes and feature sets, and how they fit in. Specifically, I w ...more...
|
B11.0
17-Nov-09
|
|
| 34 |
|
#42113: Dropped the end of the 4th paragraph - "A - indicates a number match: one of the numbers in the guess is the same as one of the numbers in the secret code, but in a"--Ric Turley #42113: Dropped the end of the 4th paragraph - "A - indicates a number match: one of the numbers in the guess is the same as one of the numbers in the ...more...
|
B13.0
20-Jan-10
|
|
| 34 |
|
#42169: Looks like something is missing at the end of this paragraph:
A - indicates a number match: one of the numbers in the guess is the same as one of the numbers in the secret code, but in a--Bruno Grasselli #42169: Looks like something is missing at the end of this paragraph:
A - indicates a number match: one of the numbers in the guess is the same as ...more...
|
B13.0
24-Jan-10
|
|
| 34 |
|
#42183: Suggest reworking the first sentence to read as follows:
3.1 Introducing Codebreaker
Codebreaker is a two-person logic game in which a player, the code-breaker, tries to break a secret code created by the other player, the code-maker.--Robert Winter #42183: Suggest reworking the first sentence to read as follows:
3.1 Introducing Codebreaker
Codebreaker is a two-person logic game in which a playe ...more...
|
B13.0
25-Jan-10
|
|
| 34 |
|
#42184: Suggest changing your example to make it really clear (or really difficult to confuse) that the '+' and '-' do not correspond to positions:
"For example, given a secret code of 1234, a guess of 2536 would be marked '+-'"
The two, earning a '-', is first in sequence, but marked second, and the three is later in the sequence, but marked '+' first.--Robert Winter #42184: Suggest changing your example to make it really clear (or really difficult to confuse) that the '+' and '-' do not correspond to positions:
...more...
|
B13.0
25-Jan-10
|
|
| 34 |
|
#42196: 3.1 Introducing Codebreaker, 4th paragraph : For example, given a secret code …
In B12, I made a wrong assumption about the black marker and the green peg in the second position. I read the new chapter 3 and again believe that the + comes first because it corresponds to the ones. Even if the next paragraph makes it clear that there is no particular order, I agree with #42184. So it would read :
For example, given a secret code 1234, a guess with 2536 would earn a +-. The + is for the 3 in the third position in the guess, …
Sounds that 3 is bound to third position ? I had an idea to completely scramble/mix up numbers and positions :
For example, given a secret code 1236, a guess with 2456 would earn a +-. The + is for the 6 in the fourth position in the guess, … The - is for the 2 in the first position in the guess …
… but it no longer corresponds to all the examples with 1234. What a headache !
--Bernard Kaiflin #42196: 3.1 Introducing Codebreaker, 4th paragraph : For example, given a secret code …
In B12, I made a wrong assumption about the black marker an ...more...
|
B13.0
26-Jan-10
|
|
| 36 |
|
#42115: In the "Focus on the Role" section, the "Coh04" link Is being displayed in bright green. This is incredibly hard to read on the gray background.
I'm viewing the PDF using Preview.app on a 13" Macbook Pro running Snow Leopard (10.6.2). I don't think I have done any customization that would cause the color to be different on my system, but don't remember for sure.
The same bright green link also appears in the body text on Page 35 ("JAH02") and, while it's easier to read on a white background, it is still somewhat painful.
I do see that this is the same in other PragPub books (e.g. Agile Web Development with Rails) so maybe it is something particular to my machine. At any rate, I thought I'd point it out in case it is something that could be configured in your PDF files.--Paul Nelson #42115: In the "Focus on the Role" section, the "Coh04" link Is being displayed in bright green. This is incredibly hard to read on the gray backgroun ...more...
|
B13.0
20-Jan-10
|
|
| 40 |
|
#40762: Downloads of code on this page have #START, #END in them ie:
#START:title_and_narrative
Feature: code-breaker starts game
As a code-breaker
I want to start a game
So that I can break the code
#END:title_and_narrative
#START:scenario_only
Scenario: start game
Given I am not yet playing
When I start a new game
Then the game should say "Welcome to Codebreaker!"
And the game should say "Enter guess:"
#END:scenario_only
--Sonia Hamilton #40762: Downloads of code on this page have #START, #END in them ie:
#START:title_and_narrative
Feature: code-breaker starts game
As a code-b ...more...
|
B9.0
17-Sep-09
|
|
| 42 |
|
#42116: In the fifth paragraph that begins "Inside the codebreaker directory", the feature file name should be "codebreaker_starts_game.feature" as I'm pretty sure we're breaking "codes", not fish ("cods"). ;-)--Paul Nelson #42116: In the fifth paragraph that begins "Inside the codebreaker directory", the feature file name should be "codebreaker_starts_game.feature" as I' ...more...
|
B13.0
20-Jan-10
|
|
| 44 |
|
#42120: This is definitely nit-picking, but the feature's explanation text is not parallel. I think it would read better as follows:
For each number in the guess that matches the number and position of a number in the secret code, the mark includes one +. For each number in the guess that matches the number but not the position of a number in the secret code, the mark includes one -.
The only change is the final phrase: "the mark includes one -."--Paul Nelson #42120: This is definitely nit-picking, but the feature's explanation text is not parallel. I think it would read better as follows:
For each numbe ...more...
|
B13.0
20-Jan-10
|
|
| 47 |
|
#42248: From the Scenario Outline on this page you can infer that the mark will always print the +'s before the -'s. But this fact is never explicitly stated anywhere. And in fact, I completely missed it on my first run through. It wasn't until the later chapter where you deal with duplicates that I realized the rule was already implied.
Is there some way that the Cucumber could updated to make this rule explicit in order to avoid confusion and increase communication? It could be added to the feature description, but it seems like it would be even better if it actually became an explicitly stated rule of its own. Is this possible?
Thanks!--Kevin Berridge #42248: From the Scenario Outline on this page you can infer that the mark will always print the +'s before the -'s. But this fact is never explicitl ...more...
|
B13.0
04-Feb-10
|
|
| 47 |
|
#42173: Here’s the whole feature with thirteen scenarios expressed in a
mere twenty five lines (beginning with the Scenario Outline):
Scenario Outline: submit guess
Given the secret code is "<code>"
When I guess "<guess>"
Then the mark should be "<mark>"
Scenarios: no matches
| code | guess | mark |
| 1234 | 5678 | |
Scenarios: 1 number correct
| code | guess | mark |
| 1234 | 1555 | + |
| 1234 | 2555 | - |
Scenarios: 2 numbers correct
| code | guess | mark |
| 1234 | 5254 | ++ |
| 1234 | 5154 | +- |
| 1234 | 2545 | -- |
Scenarios: 3 numbers correct
| code | guess | mark |
| 1234 | 5234 | +++ |
| 1234 | 5134 | ++- |
| 1234 | 5124 | +-- |
| 1234 | 5123 | --- |
Scenarios: all numbers correct
| code | guess | mark |
| 1234 | 1234 | ++++ |
| 1234 | 1243 | ++-- |
| 1234 | 1423 | +--- |
| 1234 | 4321 | ---- |
I think this is 14 in 27--Brad Hutchins #42173: Here’s the whole feature with thirteen scenarios expressed in a
mere twenty five lines (beginning with the Scenario Outline):
Scenario Out ...more...
|
B13.0
24-Jan-10
|
|
| 47 |
|
#42197: Scenarios: no matches
| code | guess | mark |
| 1234 | 5678 | |
Isn’t 78 in contradiction with 3.1 page 34 second paragraph : the code-breaker makes a guess of four numbers (again, 1 to 6) ?
--Bernard Kaiflin #42197: Scenarios: no matches
| code | guess | mark |
| 1234 | 5678 | |
Isn’t 78 in contradiction with 3.1 page 34 second paragraph : the c ...more...
|
B13.0
26-Jan-10
|
|
| 50 |
|
#42119: Second paragraph ends with "Here are the contents of the two files:" and there are no contents listed.--Craig Ritchie
|
B13.0
20-Jan-10
|
|
|
50 |
#42172: I am getting the following error after I put in the second feature of the Mastermind game and run cucumber.
features/codebreaker_submits_guess.feature:20:2: Parse error, expected "|". (Cucumber::Parser::SyntaxError)
It seems to be expecting another pipe but all looks good. Her is the code around line 20. With line 20 being the first line of the second scenario.
Scenario: no matches
| code | guess | mark |
| 1234 | 5678 | |
Scenarios: 1 number correct
| code | guess | mark |
| 1234 | 1555 | + |
| 1234 | 2555 | - |
cucumber 0.6.2
OS X 10.6.2
Ruby 1.8.7--Brad Hutchins #42172: I am getting the following error after I put in the second feature of the Mastermind game and run cucumber.
features/codebreaker_submits_ ...more...
David Chelimsky says: I'm not getting this error. Please report it to the cucumber google group: http://groups.google.com/group/cukes.
|
B13.0
24-Jan-10
|
|
| 51 |
|
#42198: Suggest to put the figure 4-1 back.
Reason : as I tried running cb/04 (old code) on page 55, I was stuck with require errors and wanted to check if my directory structure is correct, but couldn’t find the figure, which has been removed from B13.
I had appreciated the figure 4-1 and the following explanations on pages B12 51-52, especially the parallelism between lib and spec (related to the updating of $LOAD_PATH in env.rb, something not familiar for a newbie). I have adopted this scheme for my RSpec development now, lib + spec with a require_helper.rb similar to env.rb.
--Bernard Kaiflin #42198: Suggest to put the figure 4-1 back.
Reason : as I tried running cb/04 (old code) on page 55, I was stuck with require errors and wanted to ...more...
|
B13.0
26-Jan-10
|
|
| 54 |
|
#42283: On page 54 of B13, the last line of the output of the example cucumber run from the page before is listed directly below the sidebar. Because it's a single line, it would probably be a good thing to find a way to put it with the rest of the output. "0m0.003s" looks pretty odd after the sidebar, especially considering the page content doesn't describe that line at all.--Jon Mischo #42283: On page 54 of B13, the last line of the output of the example cucumber run from the page before is listed directly below the sidebar. Because ...more...
|
B13.0
09-Feb-10
|
|
| 56 |
|
#40205: Wrong line number (minor problem!)
uninitialized constant Codebreaker (NameError)
./06/features/step_definitions/codebreaker.rb:7:in
`/^I start a new game$/'
/IF/ you use the code providerd (cb/06), the line should be 15. The difference is due to the 8 comment lines.--Juan Gabardini #40205: Wrong line number (minor problem!)
uninitialized constant Codebreaker (NameError)
./06/features/step_definitions/codebreaker.rb:7:in
`/^I ...more...
|
B8.0
26-Jul-09
|
|
| 56 |
|
#42122: The second sentence of the "Then" section is problematic.
BTW, the Existing Errata I am seeing doesn't seem to match the page I'm looking at.
In the RSpec book, the second sentence of the "Then" section that begins on page 55 is problematic. I believe it should read:
The last snippet is a single step definition that will handle both the Then and And steps in the scenario, passing whatever is captured by the ([^\"]*) part of the regular expression to the method block as the message parameter.
I added a "the" before "([^\"]*)", removed a "the" from between "regular expression" and "to the block", and added the modifier "method" in front of the word "block" to make it more obvious which block we are dealing with.--Paul Nelson #42122: The second sentence of the "Then" section is problematic.
BTW, the Existing Errata I am seeing doesn't seem to match the page I'm looking a ...more...
|
B13.0
20-Jan-10
|
|
| 56 |
|
#42170: Then /^I should see "([^\"]*)" $/ do |message|
should be
Then /^I should see "([^\"]*)"$/ do |message| as is the downloaded code
Note the space in the text causes the output to differ from what is shown...--Asa Bour #42170: Then /^I should see "([^\"]*)" $/ do |message|
should be
Then /^I should see "([^\"]*)"$/ do |message| as is the downloaded code
Note t ...more...
David Chelimsky says: It is correct in the PDF. What PDF viewer are you using?
|
B13.0
24-Jan-10
|
|
| 60 |
|
#42117: #start (last but one line) is formatted green like a comment, but isn't a comment.--Pete Bevin
|
B13.0
20-Jan-10
|
|
| 60 |
|
#42175: I had to play with the $LOAD_PATH to get this command to work:
spec spec/codebreaker/game_spec.rb --format nested
Ubuntu:
spec_helper.rb:
$LOAD_PATH << File.expand_path(File.join('..', 'lib'), File.dirname(__FILE__))
game_spec.rb:
$LOAD_PATH << File.expand_path(File.join('..'), File.dirname(__FILE__))
--Asa Bour #42175: I had to play with the $LOAD_PATH to get this command to work:
spec spec/codebreaker/game_spec.rb --format nested
Ubuntu:
spec_helper.r ...more...
David Chelimsky says: The current version of rspec, 1.3, add lib to the load path. Are you using an older version?
|
B13.0
24-Jan-10
|
|
| 61 |
|
#42118: Two lines with #start are formatted green like comments, but aren't comments.--Pete Bevin
|
B13.0
20-Jan-10
|
|
| 61 |
|
#42239: I had to change spec/spec_helper.rb to include the following to get the spec to run
$LOAD_PATH << File.expand_path('../../codebreaker/lib', __FILE__)
prior to the
require 'codebreaker'
--joe #42239: I had to change spec/spec_helper.rb to include the following to get the spec to run
$LOAD_PATH << File.expand_path('../../codebreaker/lib', ...more...
David Chelimsky says: The current version of rspec, 1.3, add lib to the load path. Are you using an older version?
|
B13.0
01-Feb-10
|
|
| 63 |
|
#42130: The example on this page is supposed to be demonstrating a red or failing spec, but the text is blue. Probably would be good to actually see a red failing spec.--Ryan Billingsley #42130: The example on this page is supposed to be demonstrating a red or failing spec, but the text is blue. Probably would be good to actually see ...more...
|
B13.0
21-Jan-10
|
|
| 63 |
|
#42132: The last paragraph of section 5.2 indicates that I should see a FAILED-1 on the third line of the output, but I am not seeing this. The reason is that you give the command as:
spec spec --color
In order for the output to match what you have listed in the book, the command should be:
spec spec --color --format nested--Paul Nelson #42132: The last paragraph of section 5.2 indicates that I should see a FAILED-1 on the third line of the output, but I am not seeing this. The reason ...more...
|
B13.0
21-Jan-10
|
|
| 70 |
|
#42133: In the second clause of the second sentence of the paragraph that begins "The first call to let() defines...", "return" should be "returned":
"...and that same value is return[ed] every subsequent time..."--Paul Nelson #42133: In the second clause of the second sentence of the paragraph that begins "The first call to let() defines...", "return" should be "returned":
...more...
|
B13.0
21-Jan-10
|
|
| 71 |
|
#42134: The instruction to "chmod 755 bin/codebreaker" only applies to *nix systems... unless there was an instruction that I missed for Windows users to install and use Cygwin. :)
Also, wouldn't it be a bit safer to give the command as "chmod +x bin/codebreaker"? Or maybe that's not available on all *nix systems. <shrug>--Paul Nelson #42134: The instruction to "chmod 755 bin/codebreaker" only applies to *nix systems... unless there was an instruction that I missed for Windows users ...more...
|
B13.0
21-Jan-10
|
|
| 75 |
|
#42123: Given /^the secret code is "([^\"]*)"$/ do |secret|
game = Codebreaker::Game.new(output)
game.start(secret)
end
should be
Given /^the secret code is "([^\"]*)"$/ do |secret|
@game = Codebreaker::Game.new(output)
@game.start(secret)
end
Otherwise this code found on page 78
When /^I guess "([^\"]*)"$/ do |guess|
@game.guess(guess)
end
will return different results then shown because @game will be nil.--Craig Ritchie #42123: Given /^the secret code is "([^\"]*)"$/ do |secret|
game = Codebreaker::Game.new(output)
game.start(secret)
end
should be
Given / ...more...
|
B13.0
20-Jan-10
|
|
| 78 |
|
#42226: in cb2/19/features/step_definitions/codebreaker_steps.rb, your When instantiates Game with a local variable (game = Codebreaker::Game.new(output)). On the next page, in cb2/20/features/step_definitions/codebreaker_steps.rb, your When refers to the Game object as an instance variable (@game.guess(guess)). This doesn't work, resulting in a confusing error: "undefined method 'guess' for nil:NilClass".
If the Game object is instantiated with an instance variable, then the example works as described on page 78.--Michael Macdonald #42226: in cb2/19/features/step_definitions/codebreaker_steps.rb, your When instantiates Game with a local variable (game = Codebreaker::Game.new(outp ...more...
|
B13.0
01-Feb-10
|
|
| 79 |
|
#42135: Code snippet at top of page is missing the '@' symbol in front of output. --Sid Wood
David Chelimsky says: Take a look at p56 in beta 13. It shows an output() method that encapsulates the instance variable, so no @ is needed.
|
B13.0
22-Jan-10
|
|
| 79 |
|
#42144: Section 6.3, "What We've Learned" is empty. I'm pretty sure I learned something. :)--Paul Nelson
|
B13.0
22-Jan-10
|
|
| 79 |
|
#42163: When you introduce the game of Codebreaker you mention that "The code-maker, which will be played by the application we’re going to write, creates a secret code of four numbers between 1 and 6." Since valid numbers are only between 1 and 6, why would we include scenarios that (seemingly arbitrarily) try guessing numbers above 6? Your scenarios:
Scenarios: no matches
| code | guess | mark |
| 1234 | 5678 | |
Further, your rules differ from the Bulls and Cows game mentioned on Wikidpedia in that (later on in the book) you allow duplicate numbers in the secret code, and the original game rules state that "the digits must all be different" (they also seem to allow all digits, 1-9). This is suggested by your test scenarios on page 112:
Scenarios: matches with duplicates
| code | guess | mark |
.
.
| 1134 | 1155 | ++ |
.
.
.
This wasn't confusing to me until I hit Chapter 9 (specifically section 9.1), when you went in a direction that seems counterintuitive to me, having referenced the original game rules, and comparing the written instructions to the examples.
To be clear, I'm not bothered by your rules being different from the original game, I just think the examples lack some continuity, causing confusion for the reader... at list this reader spent a few befuddled minutes getting back on track. :)--Paul Nelson #42163: When you introduce the game of Codebreaker you mention that "The code-maker, which will be played by the application we’re going to write, cre ...more...
|
B13.0
23-Jan-10
|
|
| 81 |
|
#42145: The output from my spec command does not match what is listed.
Using the command:
spec spec --color --format nested
My output is:
Codebreaker::Game
#start
sends a welcome message
prompts for the first guess
#guess
with no matches
sends a mark with '' (FAILED - 1)
1)
Spec::Mocks::MockExpectationError in 'Codebreaker::Game#guess with no matches sends a mark with '''
Double "output" expected :puts with ("") once, but received it 0 times
/Users/pablosan/Source/codebreaker/spec/codebreaker/game_spec.rb:26:in `block (4 levels) in <module:Codebreaker>'
/opt/local/lib/ruby1.9/1.9.1/timeout.rb:44:in `timeout'
Finished in 0.005912 seconds
3 examples, 1 failure
--- end of output ---
Specifically, I don't see the verbiage you have in your example:
Double "output" received :puts with unexpected arguments
expected: ("") got: (["Welcome to Codebreaker!"], ["Enter guess:"])
--- end of output ---
Upon further inspection, specifically of the trace in my output, I'm thinking there might be some configuration funkiness on my machine that is causing this?
I remember seeing something about configuration that would give a listing of all output like I see in your example. I just don't remember if it was in the book or in other errata comments.--Paul Nelson #42145: The output from my spec command does not match what is listed.
Using the command:
spec spec --color --format nested
My output is:
...more...
|
B13.0
22-Jan-10
|
|
| 83 |
|
#42149: The code example that comes after the paragraph that begins "The current implementation of guess always sends an empty string..." is incomplete and will not make the test pass. This is because the code references an instance variable, "@secret" that has never been defined.
This code snippet should include adding a new line to the "start" method that stores the passed in "secret" in an instance variable:
def start(secret)
@output.puts 'Welcome to Codebreaker!'
@output.puts 'Enter guess:'
@secret = secret
end--Paul Nelson #42149: The code example that comes after the paragraph that begins "The current implementation of guess always sends an empty string..." is incomplet ...more...
|
B13.0
22-Jan-10
|
|
| 83 |
|
#42179: At some point in section 7.1 we need to update the start method by adding @secret = secret. I don't think you tell us that. I figured it out by debugging an error but I thought I'd let you know.
def start(secret)
@secret = secret
@output.puts 'Welcome to Codebreaker!'
@output.puts 'Enter guess:'
end
Love the book!--KRISTEN HAZARD #42179: At some point in section 7.1 we need to update the start method by adding @secret = secret. I don't think you tell us that. I figured it out ...more...
|
B13.0
25-Jan-10
|
|
| 85 |
|
#42150: This is nit-picking again, but...
To maintain symmetry and improve readability, I would swap your order of secret and guess (so that it parallels the elsif check):
def guess(guess)
if @secret[0] == guess[0]
mark = '+'
elsif @secret.include?(guess[0])
mark = '-'
else
mark = ''
end
I know this code is throw away code, but it may not always be. So I prefer to make even (potential) throw-away code as readable as possible, especially when putting an example in a book.--Paul Nelson #42150: This is nit-picking again, but...
To maintain symmetry and improve readability, I would swap your order of secret and guess (so that it par ...more...
David Chelimsky says: This is very subjective. I actually prefer the way it is in the book because we're saying "if the first number in the guess is the first number in the secret .."
|
B13.0
22-Jan-10
|
|
| 87 |
|
#42151: Something is bothering me about the game.rb test cases. There is duplication in the line:
game.start('1234')
It appears in every test case, yet I'm not sure refactoring that line out into a before method is a good idea. The more I thought about it, the more I realized that my hang-up was with the fact that we always used the same secret code. That seems like a test smell to me: we could end up with an implementation that would only work when the secret code is '1234'.
So I think I would change the secret code for every test... or at least use more than one secret code in the test cases.--Paul Nelson #42151: Something is bothering me about the game.rb test cases. There is duplication in the line:
game.start('1234')
It appears in every test ca ...more...
David Chelimsky says: I like your instinct, and might consider that if it weren't a teaching example. In an earlier version of the book there were some different codes and other beta readers expressed confusion about it :)
|
B13.0
22-Jan-10
|
|
| 87 |
|
#42152: In implementing the loop in the guess method, why did you opt for Array#map? map creates an (unnecessary) new array containing the values returned by the block. Instead of:
(0..3).map do |index|
The correct method to use in this case is each:
(0..3).each do |index|--Paul Nelson #42152: In implementing the loop in the guess method, why did you opt for Array#map? map creates an (unnecessary) new array containing the values retu ...more...
|
B13.0
22-Jan-10
|
|
| 90 |
|
#42249: "Learned" is misspelled as "leared" in the last sentence before section 7.4, a sentence that also incorrectly separates "meantime" into "mean time":
"In the mean time, let's review what we've leared so far."
Since Shakespeare is the only person who ever Leared in the (Greenwich) Mean Time, the book should probably target the rest of us and the learning we do in the meantime.--Steve #42249: "Learned" is misspelled as "leared" in the last sentence before section 7.4, a sentence that also incorrectly separates "meantime" into "mean ...more...
|
B13.0
04-Feb-10
|
|
| 92 |
|
#42250: You begin Chapter 8 with nearly the same Fowler quote that you began section 5.4 with, though they are different in their wording:
5.4
In the preface to his seminal book on Refactoring [FBB99], Martin Fowler writes: “Refactoring is the process of changing a software system in such a way that it does not alter the external behaviour of the code yet improves its internal structure.”
Chapter 8
In his book, Refactoring [FBB+99], Martin Fowler describes refactoring as “a change made to the internal structure of software to make it easier to understand and cheaper to modify without changing its observable behavior.”
Reading the quote in chapter 8, it feels as if the authors have unintentionally repeated themselves, even though the second quote adds some new ideas. Maybe it should be introduced in a way that acknowledges that Fowler has already been mentioned, then says that Fowler further defines refactoring as such and such (using the quote).--Steve #42250: You begin Chapter 8 with nearly the same Fowler quote that you began section 5.4 with, though they are different in their wording:
5.4
In ...more...
|
B13.0
04-Feb-10
|
|
| 96 |
|
#42155: In the game.rb code example at the end of the page, the marker for a change to the code is wrong: nothing was change on the line:
@output.puts '+'*exact_match_count(guess) + '-'*number_match_count
The only change to this method was the removal of a line of code: the declaration of the local variable exact_match_count at the beginning of the method.--Paul Nelson #42155: In the game.rb code example at the end of the page, the marker for a change to the code is wrong: nothing was change on the line:
@output.p ...more...
David Chelimsky says: As the previous paragraph suggests, that line changes to pass the guess to the exact_match_count method.
|
B13.0
23-Jan-10
|
|
| 97 |
|
#42156: In the code snippet showing the method exact_match_count, there is a change marker on the line:
if exact_match?(guess, index)
Nothing changed on this line of code as far as I can tell.--Paul Nelson #42156: In the code snippet showing the method exact_match_count, there is a change marker on the line:
if exact_match?(guess, index)
Nothing ch ...more...
|
B13.0
23-Jan-10
|
|
| 97 |
|
#42157: The last line of the page and the section has a typo:
Run the specs and the should all pass.
The second "the" should be "they":
Run the specs and they should all pass.--Paul Nelson #42157: The last line of the page and the section has a typo:
Run the specs and the should all pass.
The second "the" should be "they":
Run t ...more...
|
B13.0
23-Jan-10
|
|
| 98 |
|
#42158: In the paragraph that begins "Briefly, what's happening is that..." The word "iteration" in the last sentence of the paragraph should be "iterating":
The second block argument is the next value in the collection we’re -=>iterating<=- on: 0 the first time, 1 the second, etc.
Also, the "Briefly, what's happening is that..." is a bit too conversational for my tastes. It reads a bit awkwardly (kind of like this sentence). Consider:
Here is a brief explanation: the count variable is initialized...
...or something.--Paul Nelson #42158: In the paragraph that begins "Briefly, what's happening is that..." The word "iteration" in the last sentence of the paragraph should be "iter ...more...
|
B13.0
23-Jan-10
|
|
| 100 |
|
#42159: In the bullet points beneath "Extract Class", the slash should be removed from "as/is" in the third bullet point, yielding "as is".--Paul Nelson
|
B13.0
23-Jan-10
|
|
| 100 |
|
#42160: In the bullet points beneath "Extract Class", the fourth bullet point incorrectly suggests passing the guess parameter to Marker.new. We should, in fact, be passing the secret instance variable to Marker.new.--Paul Nelson #42160: In the bullet points beneath "Extract Class", the fourth bullet point incorrectly suggests passing the guess parameter to Marker.new. We shoul ...more...
|
B13.0
23-Jan-10
|
|
| 102 |
|
#42180: marker = Marker.new(@secret, guess)
should be updated to remove instance variable
marker = Marker.new(secret, guess)--E Asa Bour
David Chelimsky says: There is no local variable there - the @secret _is_ an instance variable.
|
B13.0
25-Jan-10
|
|
| 106 |
|
#42121: "documents it's responsibility" s/b "documents its responsibility"--Pete Bevin
|
B13.0
20-Jan-10
|
|
| 106 |
|
#42161: The sentence "It’s still responsible for sending a mark to the output, but it’s no longer rep- sonsible for calculating the mark" has a spelling error: "repsonsible" should be "responsible"--Paul Nelson #42161: The sentence "It’s still responsible for sending a mark to the output, but it’s no longer rep- sonsible for calculating the mark" has a spelli ...more...
|
B13.0
23-Jan-10
|
|
| 106 |
|
#42162: I like the fact that you removed duplicate test cases from game_spec.rb. However, the single guess test case is a little simplistic. Why not test for something that covers all cases? Like:
describe "#guess" do
it "sends the mark to output" do
game.start('1234' )
output.should_receive(:puts).with('++-' )
game.guess('1354' )
end
end
The advantage here would be a chance to catch a problem introduced in the marker_spec.rb test cases: maybe someone edits the marker_spec test cases so they aren't providing the coverage needed. You'd at least have a chance of catching something at the game_spec level. <shrug>--Paul Nelson #42162: I like the fact that you removed duplicate test cases from game_spec.rb. However, the single guess test case is a little simplistic. Why not t ...more...
|
B13.0
23-Jan-10
|
|
| 112 |
|
#39655: omit (juvenile) "(It’s nice to do this from time to time anyway—it helps
their self-esteem.)" --we already *know* we have a heightened sense for cheap irony
--Jesse Crockett #39655: omit (juvenile) "(It’s nice to do this from time to time anyway—it helps
their self-esteem.)" --we already *know* we have a heightened sense ...more...
|
B7.0
26-Jun-09
|
|
| 115 |
|
#42136: Fourth paragraph (including code snippet), fourth line, sentence beginning with "There is no long a" should be "There is no longer a".--Sid Wood
|
B13.0
22-Jan-10
|
|
| 115 |
|
#42140: "There is no long a 1 in the secret, so we move on to the 4 in the third position of the guess." should be
"There is no longer a 1 in the secret, so we move on to the 4 in the third position of the guess."--Ryan Billingsley #42140: "There is no long a 1 in the secret, so we move on to the 4 in the third position of the guess." should be
"There is no longer a 1 in the s ...more...
|
B13.0
22-Jan-10
|
|
| 116 |
|
#42164: Like I mentioned with your use of the map iterator method earlier, I really think the each iterator method is more appropriate in this case. This change would need to be made in both code snippets on the page.--Paul Nelson #42164: Like I mentioned with your use of the map iterator method earlier, I really think the each iterator method is more appropriate in this case. T ...more...
|
B13.0
23-Jan-10
|
|
| 118 |
|
#42244: "To be clear, this <<<is>>> not production code, and is not intended to be shipped."--Thibaut Courouble
|
B13.0
02-Feb-10
|
|
| 118 |
|
#42201: starting **poing** for continued development.--Sean P. DeNigris
|
B13.0
27-Jan-10
|
|
| 121 |
|
#39658: "Whether this is due to real understanding and value of Agile principles, or simply a marketing ruse, only time will tell." over "Whether this is due to them understanding and valuing the underlying principles of Agile or simply a marketing ruse to dress up the same old tired processes is left as an exercise for the reader."
--Jesse Crockett #39658: "Whether this is due to real understanding and value of Agile principles, or simply a marketing ruse, only time will tell." over "Whether this ...more...
|
B7.0
26-Jun-09
|
|
| 135 |
|
#42191: behaviour should be behavior
--Asa Bour
David Chelimsky says: We use the British spelling for behaviour since it's in the title of the book.
|
B13.0
26-Jan-10
|
|
| 136 |
|
#42238: Second parapgrah: "…, as you should already have a decent feel for how to do go about it". The "how to do go about it" should be "how to do it"
|
B13.0
01-Feb-10
|
|
| 147 |
|
#42174: Maybe I missed the explanation somewhere in the book, but you mention that the "it" method accepts a string and an optional Hash along with the optional block. What is the Hash's purpose? Shouldn't there be an example of how to use the optional Hash parameter?
I checked the ri documentation for RSpec, but that didn't help a whole lot either. My next step will be to Google it, but it seems like this book has a responsibility to cover this feature.--Paul Nelson #42174: Maybe I missed the explanation somewhere in the book, but you mention that the "it" method accepts a string and an optional Hash along with th ...more...
|
B13.0
24-Jan-10
|
|
| 149 |
|
#42168: In the RSpec examples earlier in the book, you pass a string parameter to "describe" that includes the pound/hash/number sign. Example:
describe "#start" do
Having used other BDD frameworks like JSpec and JBehave, it was not clear to me why the pound sign was prepended to the string. I'm guessing it is done to match the convention of Ruby's ri documentation tool, but it might be nice to have this convention explained in this section of the book, where "describe" is explored in detail.--Paul Nelson #42168: In the RSpec examples earlier in the book, you pass a string parameter to "describe" that includes the pound/hash/number sign. Example:
des ...more...
|
B13.0
24-Jan-10
|
|
| 165 |
|
#41742: The paragraph "Outcome-based planning" ends with "and that that’s ok" which might be correct but the two "that" sound very strange and could it be dropped anyways.--Thomas R. Koll #41742: The paragraph "Outcome-based planning" ends with "and that that’s ok" which might be correct but the two "that" sound very strange and could i ...more...
|
B12.0
07-Dec-09
|
|
| 167 |
|
#42243: - One goal BDD is getting the words right.
+ One goal of BDD is getting the words right.
It occurs to me now that this might be a joke, but I suspect that the humor will be lost on many readers who will assume that it's a typo.--Michael Macdonald #42243: - One goal BDD is getting the words right.
+ One goal of BDD is getting the words right.
It occurs to me now that this might be a joke, bu ...more...
|
B13.0
02-Feb-10
|
|
| 178 |
|
#42257: In Ruby, there are two values that are evaluate as false in a boolean expression.
Change "are evaluate" to "evaluate."--Asa Bour
|
B13.0
05-Feb-10
|
|
| 181 |
|
#38400: In the description of attach_file, there is all of a sudden the mention of "Photo". I took me a while to figure out how it relates to the form field. An example form would be nice here.--Patrick Debois #38400: In the description of attach_file, there is all of a sudden the mention of "Photo". I took me a while to figure out how it relates to the form ...more...
|
B2.0
19-Mar-09
|
|
| 188 |
|
#38801: Isn't a full page for a screenshot of the rails project tree a bit generous? Couldn't be represented as a diagram, and to keep it consistent with the tree shown for the Mastermind game at the beginning of the book? --Robert Gravina #38801: Isn't a full page for a screenshot of the rails project tree a bit generous? Couldn't be represented as a diagram, and to keep it consistent w ...more...
|
B3.0
09-Apr-09
|
|
| 207 |
|
#40847: The first code example in section 14.2 Method Stubs has misleading code highlighting.
On line 6 of the code example:
statement.generate.should =~ /^Statement for Aslak/
The word "for" is highlighted as a ruby keyword, and led me to some head scratching.
--Timothy Elliott #40847: The first code example in section 14.2 Method Stubs has misleading code highlighting.
On line 6 of the code example:
statement.generate.sh ...more...
|
B9.0
22-Sep-09
|
|
| 221 |
|
#38649: To set up HTTP headers in Webrat, the text suggests the following:
Given /^I'm browsing the site using Safari$/ do
header "User-Agent" , "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_6; en-us)"
end
On its own, this is not enough; you must also explicitly call headers in your request, e.g.:
get '/', nil, headers
Then, all is well.
Cheers,
- Brad Heintz
brad.heintz@gmail.com--Brad Heintz #38649: To set up HTTP headers in Webrat, the text suggests the following:
Given /^I'm browsing the site using Safari$/ do
header "User-Agent" , ...more...
|
B3.0
31-Mar-09
|
|
| 225 |
|
#40947: Add some introductory/explanatory text to the example code in the "Yielding" subsection--Tim Uttormark
|
B10.0
07-Oct-09
|
|
| 227 |
|
#41788: This section indicates that a clarification will be made about the differences of using stub, mock and double to make a spec more clear, but I don't think it is really addressed in the chapter. After finishing the chapter, I am still unsure of when to really use mock vs. double. The chapter alludes that mock presents a tighter connection to the subject of the spec than stub, but the double instance doesn't seem to be addressed.--Marli Baumann #41788: This section indicates that a clarification will be made about the differences of using stub, mock and double to make a spec more clear, but I ...more...
|
B12.0
11-Dec-09
|
|
| 234 |
|
#42199: Last paragraph : By default, the spec command only loads files ending with _spec.rb. As you’ll see later in this chapter, … you can configure RSpec …
I haven’t found an explicit explanation in the rest of the chapter. Suggestion if it is not elsewhere :
By default, the spec command only loads files ending with _spec.rb. While this pattern is the convention, you can configure RSpec to load files based on any pattern you choose. For example, if your files end with _t.rb, add the following option :
--pattern *_t.rb
--Bernard Kaiflin #42199: Last paragraph : By default, the spec command only loads files ending with _spec.rb. As you’ll see later in this chapter, … you can configure ...more...
|
B13.0
26-Jan-10
|
|
| 240 |
|
#42200: Paragraph “Invoke With Options Stored in a File with –options”
Suggestion : give also the short form of --options, which is uppercase -O.
Reason : having read the book “Scripted GUI testing” before, I used to run the tests with the command :
spec file.rb -fn -c
After having read this paragraph and created the spec.opts file, I naturally gave the command :
spec ./ –o spec.opts
… and it did not work !
--Bernard Kaiflin #42200: Paragraph “Invoke With Options Stored in a File with –options”
Suggestion : give also the short form of --options, which is uppercase -O.
...more...
|
B13.0
26-Jan-10
|
|
| 259 |
|
#42153: I didn't copy the example directly, but I adapted it to my own project and I found I needed to use 'def' instead of 'define_method' in my macros.--Adrian Mowat
|
B13.0
23-Jan-10
|
|
| 267 |
|
#42176: At page footer: langauges should be languages--João Vitor Lacerda Guimarães
|
B13.0
24-Jan-10
|
|
| 268 |
|
#39978: This chapter is lacking an official "What we've learned" section like the others.--Shannon -jj Behrens
|
B7.0
14-Jul-09
|
|
| 273 |
|
#42131: The sidebar states:
"For example, if you
want to use Japanese, the first 2 lines might look like this:
# language: pt
Ele Ãl’ portuguÃłs"
I believe this is Portuguese, not Japanese.--Kenrick Chien #42131: The sidebar states:
"For example, if you
want to use Japanese, the first 2 lines might look like this:
# language: pt
Ele Ãl’ portuguÃłs"
...more...
|
B13.0
21-Jan-10
|
|
| 273 |
|
#42212: It´s portuguese on the sidebar and it has some character-encoding related error. The phrase should be: Ele é português.--Lucas Prim
|
B13.0
29-Jan-10
|
|
| 276 |
|
#42177: There is an extra "about" in the last sentence of the second paragraph; "for now, let's talk about *about* the step keywords."--Sid Wood
|
B13.0
25-Jan-10
|
|
| 279 |
|
#42206: In Section 18.10, Organizing Features, second paragraph, last sentence, change from: "as described earlier in Section 19.5" to: "as described later in Section 19.5".--Gregory P. Kundla #42206: In Section 18.10, Organizing Features, second paragraph, last sentence, change from: "as described earlier in Section 19.5" to: "as described ...more...
|
B13.0
28-Jan-10
|
|
| 281 |
|
#39987: "In the above example, if we renamed the Movie class to Film, we’d have to change line 8 which uses the field id and line 13 which uses the field name, but line 3 would continue to work just fine."
Those line numbers aren't visible in the text.--Shannon -jj Behrens #39987: "In the above example, if we renamed the Movie class to Film, we’d have to change line 8 which uses the field id and line 13 which uses the fie ...more...
|
B7.0
14-Jul-09
|
|
| 281 |
|
#42207: In Section 18.11, Tags, under heading "Tags to the rescue", in the last example, change from: "OR NOT tagged with bar" to: "OR NOT tagged with @bar".--Gregory P. Kundla
|
B13.0
28-Jan-10
|
|
| 285 |
|
#42137: Duplicate "to" in second paragraph in chapter "19.2 World":
In some cases it can be handy to [to] invoke ...
|
B13.0
22-Jan-10
|
|
| 286 |
|
#42124: In the paragraph that starts with "Cucumber makes it easy...".
"Cucumber makes it easy for us to do this, but allowing us to invoke from within step definitions."
Should this be:
"Cucumber makes it easy for us to do this, by allowing us to invoke from within step definitions."?
The 'but' should be 'by'.--Jeremy Wesselman #42124: In the paragraph that starts with "Cucumber makes it easy...".
"Cucumber makes it easy for us to do this, but allowing us to invoke from wi ...more...
|
B13.0
20-Jan-10
|
|
| 286 |
|
#42125: Same paragraph as above: "Cucumber makes it easy..."
"...four-step version above, we can can write a..."
There are two cans back to back.--Jeremy Wesselman
|
B13.0
20-Jan-10
|
|
| 291 |
|
#42126: There is a type on the Scenario title.
"three of a kind beast two pair"
should be
"three of a kind beats two pair"--Jeremy Wesselman
|
B13.0
20-Jan-10
|
|
| 291 |
|
#42202: Scenario: three of a kind ***beast*** two pair
Should be "beats"--Sean P. DeNigris
|
B13.0
27-Jan-10
|
|
| 292 |
|
#42127: In the middle of the first paragraph on the page:
"...and stores the cell vlues in a..."
should be
"...and stores the cell values in a..."--Jeremy Wesselman
|
B13.0
20-Jan-10
|
|
| 298 |
|
#39085: Is it really necessary to repeat every matcher for the "should_not" version? I think it just clutters up the chapter.--Scott Johnson
|
B4.0
04-May-09
|
|
| 300 |
|
#39771: rspec-rails ActiveRecord::Error mocking
For outside-in view specs it would be useful to see how to mock ActiveRecord errors, for example I want to implement
it "should render an error message if errors are present"
as part of my view spec, which I am amending after finding in a feature that I had no validation error messages showing up on the page to tell the user what they did wrong.
Some general advice on mocking these complex objects (where you could just stub the action you know your view uses, error_messages_for() in this case, but that would be fragile if, for example, the view were changed to use error_message_for several times instead).--Nick Rutherford #39771: rspec-rails ActiveRecord::Error mocking
For outside-in view specs it would be useful to see how to mock ActiveRecord errors, for example I ...more...
|
B7.0
30-Jun-09
|
|
| 300 |
|
#42147: In section 20.2 (Setting up a Rails project), in the list of gems to install, it says:
$ [sudo] gem install selenium-client --version 0.2.18
I suspect the selenium-client version is actually supposed to be 1.2.18.
--Al #42147: In section 20.2 (Setting up a Rails project), in the list of gems to install, it says:
$ [sudo] gem install selenium-client --version 0.2 ...more...
|
B13.0
22-Jan-10
|
|
|
302 |
#42108: When explaining the output of script/generate cucumber there is no description for config/cucumber.yml. --Cory Foy
|
B13.0
19-Jan-10
|
|
|
303 |
#42105: Second para after "Bundling in vendor/gems" - "With that configration in place" should be "With that config*u*ration in place"--Cory Foy
|
B13.0
19-Jan-10
|
|
|
303 |
#42109: For the "Bundling in vendor/gems" and "Bundling in vendor/plugins" - what I forsee happening is someone relatively new to Rails reading the book and following it blindly, but being confused when they get here. Some more context as to /why/ one would pick one, the other, or neither might be helpful. Maybe a little callout section or something just before those two sections.--Cory Foy #42109: For the "Bundling in vendor/gems" and "Bundling in vendor/plugins" - what I forsee happening is someone relatively new to Rails reading the bo ...more...
|
B13.0
19-Jan-10
|
|
| 303 |
|
#42114: Regarding the "Bundling in vendor/gems" section starting on p.303; Unpacking dependencies installs Nokogiri which will cause an error when running the first scenario on p.309. Shouldn't the book instruct the reader to remove Nokogiri from vendor/gems as it contains native extensions? I think this was mentioned in passing on b12 but has not been included on b13. --Sid Wood #42114: Regarding the "Bundling in vendor/gems" section starting on p.303; Unpacking dependencies installs Nokogiri which will cause an error when run ...more...
|
B13.0
20-Jan-10
|
|
|
305 |
#42106: Second sentence - "...use together to begin driving development from the outside." Thinking that should be "from the outside-in" since you say that everywhere else, including the preceding sentence. ;)
Maybe:
"So far we've explored the concepts of BDD in Rails at a high level, and set up a project with the recommended tools. In the next chapter we'll take a look at how Cucumber and Rails and be used together to really begin the outside-in development of our application. Turn the page and let's begin."
Or something like that. ;)--Cory Foy #42106: Second sentence - "...use together to begin driving development from the outside." Thinking that should be "from the outside-in" since you say ...more...
|
B13.0
19-Jan-10
|
|
| 310 |
|
#42039: script/generate cucumber - add the "--spork" unless on Windows?--Jeremy Chatfield
|
B12.0
10-Jan-10
|
|
| 318 |
|
#40121: The BD Rails: Rails Views chapter would benefit from describing how to mock/stub/place expectations on ActionView helpers, for example when using textile you may want to
@controller.template.stub!(:textilize).and_return('textiled text')
then
@controller.template.should_receive(:textilize).with(@service.teaser)
@controller.tepmlate.should_not_receive(:textilize).with(@service.name)
It took me a few hours to find this, I think it is worth adding to the chapter as these view helpers are an external dependency and their behaviour (i.e. is the textile actually converted correctly for display) seems better suited to the Cucumber level. Speccing textilize's behaviour should be done in RedCloth's own tests, not the application tests.
The minimum I would have found helpful is being told *what* to stub, it wasn't clear whether it was @controller, the helper module, or as it turned out another object which makes MVC sense but isn't mentioned in the literature.--Nicholas Rutherford #40121: The BD Rails: Rails Views chapter would benefit from describing how to mock/stub/place expectations on ActionView helpers, for example when us ...more...
|
B8.0
21-Jul-09
|
|
| 319 |
|
#42185: "Once those additions and changes are in place, re-running our scenario shows us that we’ve got one step left:1"
"Once those additions and changes are in place, re-run the scenario and you’ll see that we’ve got one step left"
Redundant sentences. --Ryan Billingsley #42185: "Once those additions and changes are in place, re-running our scenario shows us that we’ve got one step left:1"
"Once those additions and ...more...
|
B13.0
25-Jan-10
|
|
| 320 |
|
#42084: Running script/cucumber --tag @focus (on Win32) results in:
WARNING: C:/data/donp/NetBeansProjects/showtime/features/support/env.rb:18: cucumber/webrat/element_locator.rb is deprecated and will be removed in Cucumber 0.6.0.
Use cucumber/web/tableish instead.
Solution is to comment out line 18 in features/support/env.rb:
#require 'cucumber/webrat/element_locator' # Deprecated in favor of #tableish - remove this line if you don't use #element_at or #table_at
--Donald Parish #42084: Running script/cucumber --tag @focus (on Win32) results in:
WARNING: C:/data/donp/NetBeansProjects/showtime/features/support/env.rb:18: cuc ...more...
|
B12.0
15-Jan-10
|
|
| 320 |
|
#41894: script/cucumber -tag @focus fails with:
Missing these required gems:
database_cleaner >=0.2.3
I ran rake gems:install to no avail but gem install database_cleaner worked.--Asa Bour #41894: script/cucumber -tag @focus fails with:
Missing these required gems:
database_cleaner >=0.2.3
I ran rake gems:install to no avail ...more...
|
B12.0
22-Dec-09
|
|
| 322 |
|
#42100: FYI, on MS Windows XP with ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-mswin32], Time.now.strftime("%l") => "". I notice that the %l isn't documented in the Pickaxe. I used:
def formatted_time
hour = showtime_time.strftime("%I").to_i.to_s
hour + showtime_time.strftime(":%M%p").strip.downcase
end--Donald Parish #42100: FYI, on MS Windows XP with ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-mswin32], Time.now.strftime("%l") => "". I notice that the %l isn't do ...more...
|
B12.0
18-Jan-10
|
|
| 327 |
|
#42284: Missing space:
"By default, Rails’ TestUploadedFile uses the text/plainMIME type."
Should be:
"By default, Rails’ TestUploadedFile uses the text/plain MIME type."--Jon Mischo #42284: Missing space:
"By default, Rails’ TestUploadedFile uses the text/plainMIME type."
Should be:
"By default, Rails’ TestUploadedFile us ...more...
|
B13.0
09-Feb-10
|
|
| 343 |
|
#40568: I'm not sure if the Rails Controller chapter is the best place for this (or even if this is the best mechanism to suggest) but I feel that some information on using RSpec for spec'ing routes would be useful to the reader. If nothing else, it'd definitely be useful to me.--Chris Ess #40568: I'm not sure if the Rails Controller chapter is the best place for this (or even if this is the best mechanism to suggest) but I feel that som ...more...
|
B8.0
26-Aug-09
|
|
| 345 |
|
#42285: "If anything behaves differently, it’s a pointer to an inadvertent external dependency that has crept it."
Should be:
"If anything behaves differently, it’s a pointer to an inadvertent external dependency that has crept in."--Jon Mischo #42285: "If anything behaves differently, it’s a pointer to an inadvertent external dependency that has crept it."
Should be:
"If anything behav ...more...
|
B13.0
09-Feb-10
|
|
| 348 |
|
#41128: text from 348 to 351 needs breaking up with some headers. Its very easy to get lost in the example. I would suggest some sub headings like
Create Message Class
Mock As New Record
Add Input Field
Mock Title Attribute
Mock Null Object
Dry up with before(:each)
Perhaps these could be notes in the margin if titles are to unobtrusive--Andrew Premdas #41128: text from 348 to 351 needs breaking up with some headers. Its very easy to get lost in the example. I would suggest some sub headings like
...more...
|
B11.0
29-Oct-09
|
|
| 359 |
|
#42186: In the section "Extracting Partials for Organization", should the second paragraph's last sentence be changed to "... to rely on a recent_messages __local variable__ rather than on an instance variable." since the next section refers to it as a local?--Allen Ding #42186: In the section "Extracting Partials for Organization", should the second paragraph's last sentence be changed to "... to rely on a recent_mess ...more...
|
B13.0
25-Jan-10
|
|
| 367 |
|
#42222: The fourth paragraph below the section 24.5 header (including code samples), second line reads; "To see this in action, create a spec/helpers/roles.rb file." Shouldn't that be spec/helpers/application_helper_spec.rb?--Sid Wood #42222: The fourth paragraph below the section 24.5 header (including code samples), second line reads; "To see this in action, create a spec/helpers/ ...more...
|
B13.0
01-Feb-10
|
|
| 372 |
|
#40128: It seems that testing the "validates_uniqueness_of" model validation is a bit tricky. Blogs and forums I've found have a number of suggestions, but they all seem to be "workarounds" to me. This topic doesn't appear to be covered in the RSpec book (yet). I'd really like to see this topic covered.--Les Nightingill #40128: It seems that testing the "validates_uniqueness_of" model validation is a bit tricky. Blogs and forums I've found have a number of suggestions ...more...
|
B8.0
21-Jul-09
|
|
| 378 |
|
#41616: 3rd line up from the bottom of the page should say:
Now it fails with uninitialized constant FooController::AccessDenied
At least that is the error I got.--Dan Steinicke #41616: 3rd line up from the bottom of the page should say:
Now it fails with uninitialized constant FooController::AccessDenied
At least that is ...more...
|
B11.0
24-Nov-09
|
|
| 378 |
|
#42223: last sentence on page reads; "Let's look *a* closer at each of the methods we used." --Sid Wood
|
B13.0
01-Feb-10
|
|
| 379 |
|
#40234: Just another point about keeping these three chapters on Rails MVC consistent:
In the Rails controller section, the method's if clause was implemented exactly reverse:
def create
@message = Message.new params[:message]
if @message.save
flash[:notice] = "The message was saved successfully."
redirect_to messages_path
else
render :action => "new"
end
end--Florian Leitner #40234: Just another point about keeping these three chapters on Rails MVC consistent:
In the Rails controller section, the method's if clause was im ...more...
|
B8.0
28-Jul-09
|
|
| 389 |
|
#41619: This page says: "Now all examples are passing..." but I'm still getting an error: "uninitialized constant Message::User (NameError)" Looking at the schema.rb from the downloadable code it looks like a User model got generated but I don't see this mentioned in the book.
To get things working I did the following:
script/generate rspec_model user name:string email:string
rake db:migrate
rake db:test:prepare--Dan Steinicke #41619: This page says: "Now all examples are passing..." but I'm still getting an error: "uninitialized constant Message::User (NameError)" Looking ...more...
|
B11.0
24-Nov-09
|
|
| 391 |
|
#41143: This change of messages_controller break loads of the tests. It's not at all obvious how to refactor the tests and controller in tandem to achieve this. Especially as I can't see how to reference the current_user. This needs to be explained.--Brendan Maginnis #41143: This change of messages_controller break loads of the tests. It's not at all obvious how to refactor the tests and controller in tandem to ach ...more...
|
B11.0
31-Oct-09
|
|
| 395 |
|
#41956: It'd be great if you could add a note as to how to handle errors that are raised in Webrat/Cucumber. On 395, the example of implementing an "access denied" feature in your ApplicationController is a good one, but it left me lost when I did the next logical step, which was to try and build it out using Cucumber.
Here's what I tried, in the wild, with the application controller/spec implemented as suggested:
Scenario: Users cannot sign up when sign ups are disabled
Given sign ups are disabled
When I go to the sign up page
Then I should see "forbidden"
The second step (using the built-in when I go to...) causes an AccessDenied error to be thrown (as you'd expect). However, when Webrat encounters the exception, it reraises it and the test fails. I'm not sure how to handle this (maybe with lambda { visit ... } ?), but some clarification would be fantastic here, seeing as it's the next logical step someone might try.--Pete Nicholls #41956: It'd be great if you could add a note as to how to handle errors that are raised in Webrat/Cucumber. On 395, the example of implementing an "a ...more...
|
B12.0
31-Dec-09
|
|
| 395 |
|
#41957: Addendum to #41956: The solution was found in features/support/env.rb which specifies the @allow-rescue tag.--Pete Nicholls
|
B12.0
31-Dec-09
|
|
| 410 |
|
#41726: current_user is not defined in the messages_controller context, thus the spec throwing an error. --Andrei Erdoss
|
B12.0
05-Dec-09
|
|