This file contains hidden or 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 'set' | |
| class Decomposer | |
| def initialize params | |
| @uv_gen = params[:uv_gen] | |
| @qu_gen = params[:qu_gen] | |
| @qv_gen = params[:qv_gen] | |
| end | |
This file contains hidden or 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 |
This file contains hidden or 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 Monkey | |
| def self.extend_every(args) | |
| class_to_extend = args.keys.first | |
| module_to_extend_with = args.values.first | |
| class_to_extend.instance_eval <<-PATCH | |
| def new(*args) | |
| super(*args).extend(#{module_to_extend_with}) | |
| end | |
| PATCH |
This file contains hidden or 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 Monkey | |
| def self.extend_every(args) | |
| class_to_extend = args.keys.first | |
| module_to_extend_with = args.values.first | |
| class_to_extend.instance_eval <<-PATCH | |
| def new(*args) | |
| super(*args).extend(#{module_to_extend_with}) | |
| end | |
| PATCH |
This file contains hidden or 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 Outline: Permissions | |
| Given I am logged in as <User Type> | |
| When I go to the homepage | |
| Then I should see <Stuff I should see> | |
| And I should not see <Stuff I should not see> | |
| Examples: | |
| | User Type | Stuff I should see | Stuff I should not see | | |
| | Admin | New Invoice, New Category, New Project | | | |
| | User | New Invoice, New Category | New Project | |
This file contains hidden or 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 DoesStuffAroundFeatures | |
| def visit_feature(feature) | |
| puts "About to run feature #{feature.name}" | |
| super | |
| puts "I just finished that feature" | |
| end | |
| end | |
| Cucumber.configure do |config| | |
| config.extend_primary_visitor DoesStuffAroundFeatures |
This file contains hidden or 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 'rack/test' | |
| require 'webrat' | |
| require File.expand_path(File.dirname(__FILE__) + '/../../lib/stats') | |
| Webrat.configure do |config| | |
| config.mode = :rack | |
| end | |
| Stats::App.set :environment, 'cucumber' | |
| Stats::App.enable :raise_errors |
This file contains hidden or 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 Main | |
| where | |
| import Test.HUnit | |
| import Cities | |
| main = runTestTT tests | |
| tests = TestList [ | |
| "check" ~: 1 ~?= 0, |
This file contains hidden or 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
| describe "My Test" do | |
| before(:all) { puts "Running..."} | |
| describe "something" do | |
| it "should have a cool name" do | |
| "name" | |
| end | |
This file contains hidden or 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
| foo |