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
#!/usr/bin/env ruby | |
# git pre-commit hook | |
# | |
# This will ensure 100% code coverage and all specs passing before allowing a commit | |
# to the git repo. | |
# | |
# Place the file at .git/hooks/pre-commit and use chmod a+x to make it executable. | |
system('rake clean >/dev/null 2>&1') |
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
# This assumes you have the metric_fu and kablame plugins installed. | |
# For kablame I like to modify it to include your stories or features dir as well as the specs. | |
# Set the artifacts dir for development | |
ENV['CC_BUILD_ARTIFACTS'] ||= File.expand_path("#{RAILS_ROOT}/metrics") | |
rspec_base = File.expand_path("#{RAILS_ROOT}/vendor/plugins/rspec/lib") | |
$LOAD_PATH.unshift(rspec_base) if File.exist?(rspec_base) | |
require 'spec/rake/spectask' | |
require 'spec/rake/verify_rcov' |
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
#!/usr/bin/env ruby | |
spec_commands = {"1.1.12" => "spec", "#does_not_match? version" => "~/p/ruby/rspec/bin/spec"} | |
base_line = "1.1.12" | |
number_of_runs = ENV['NUMBER_OF_RUNS'] || 50 | |
class Array | |
def average | |
@average ||= self.inject{|sum,v| sum + v} / size.to_f | |
end | |
end |
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: Backgrounds | |
In order to provide a context to my scenarios within a feature | |
As a feature editor | |
I want to write a background section in my features. | |
Scenario: run a scenario with a background with a passing step | |
When I run cucumber -q features/passing_background_sample.feature:6 | |
Then it should pass with | |
""" | |
Feature: sample |
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: Scoring | |
In order to provide an enjoyable experience to my customers | |
As a bowling alley manager my customers | |
should be able to have there games scored automatically | |
Scenario Outline: |
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
module BuilderStepHelpers | |
def create_model(model_name, attributes={}) | |
send("create_#{model_name.gsub(' ','_')}",attributes) | |
end | |
end | |
World do |world| | |
world.extend BuilderStepHelpers | |
end |
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
Scenario: User confirms his account # features/sign_up.feature:23 | |
Given I signed up with "[email protected]/password" # features/step_definitions/clearance_steps.rb:13 | |
can't convert Fixjour::MergingProxy into Hash (TypeError) | |
./features/step_definitions/clearance_steps.rb:16:in `/^I signed up with "(.*)\/(.*)"$/' | |
features/sign_up.feature:24:in `Given I signed up with "[email protected]/password"' | |
When I follow the confirmation link sent to "[email protected]" # features/step_definitions/clearance_steps.rb:53 | |
Then I should see "Confirmed email and signed in" # features/step_definitions/webrat_steps.rb:89 | |
And I should be signed in |
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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'tempfile' | |
require 'nokogiri' | |
require 'rdiscount' | |
# makers-mark | |
# | |
# Generates HTML from Markdown, replacing code blocks with syntax |
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
1) | |
'Cucumber::Mate::Files::FeatureFile#steps_starting_with when 1 matching string step definition exists should return the step definition' FAILED | |
expected: 1, | |
got: 0 (using ==) | |
./spec/cucumber/mate/files/feature_file_spec.rb:135: | |
2) | |
'Cucumber::Mate::Files::FeatureFile#steps_starting_with when 1 matching regex step definition exists should return the step definition' FAILED | |
expected: 1, | |
got: 0 (using ==) |
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
module ObjectLocators | |
def the_policy | |
if @policy | |
@policy | |
else | |
case Policy.count | |
when 0 | |
raise "There is no @policy variable defined and no policy in the DB! Establish state in previous step or create a new policy." | |
when 1 |
OlderNewer