This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ gem list rspec | |
*** LOCAL GEMS *** | |
$ sudo gem install rspec --prerelease | |
Successfully installed rspec-core-2.0.0.a2 | |
Successfully installed rspec-expectations-2.0.0.a2 | |
Successfully installed rspec-mocks-2.0.0.a2 | |
Successfully installed rspec-2.0.0.a2 | |
4 gems installed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: code-breaker submits guess | |
The code-breaker submits a guess of four numbers. The game marks the guess | |
with + and - signs. | |
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, | |
a - is added to the mark. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'benchmark' | |
n = 1_000_000 | |
h = {:a => {'a' => 'A'}, :b => {'b' => 'B'}} | |
puts %Q{ | |
h.each {|kv| kv[1]} | |
} | |
Benchmark.benchmark do |bm| |