Sha256: f66e0c7c7c10f5c53bb66c0e15cd0fded8931b31a19de5dd0f669b10e16119de
Contents?: true
Size: 1.99 KB
Versions: 1
Compression:
Stored size: 1.99 KB
Contents
apply_component_for(:rspec, :test) CUCUMBER_SETUP = (<<-TEST).gsub(/^ {10}/, '') unless defined?(CUCUMBER_SETUP) PADRINO_ENV = 'test' unless defined?(PADRINO_ENV) require File.expand_path(File.dirname(__FILE__) + "/../../config/boot") require 'capybara/cucumber' require 'spec/expectations' ## # You can handle all padrino applications using instead: # Padrino.application Capybara.app = CLASS_NAME.tap { |app| } TEST CUCUMBER_YML = (<<-TEST).gsub(/^ {10}/, '') unless defined?(CUCUMBER_YML) default: --tags ~@wip --strict features html_report: --tags ~@wip --strict --format html --out=features_report.html features TEST CUCUMBER_FEATURE = (<<-TEST).gsub(/^ {10}/, '') unless defined?(CUCUMBER_FEATURE) Feature: Addition In order to avoid silly mistakes As a math idiot I want to be told the sum of two numbers Scenario: Add two numbers Given I visit the calculator page And I fill in '50' for 'first' And I fill in '70' for 'second' When I press 'Add' Then I should see 'Answer: 120' TEST CUCUMBER_STEP = (<<-TEST).gsub(/^ {10}/, '') unless defined?(CUCUMBER_STEP) Given /^I visit the calculator page$/ do visit '/add' end Given /^I fill in '(.*)' for '(.*)'$/ do |value, field| fill_in(field, :with => value) end When /^I press '(.*)'$/ do |name| click_button(name) end Then /^I should see '(.*)'$/ do |text| response_body.should contain(/#\{text}/m) end TEST def setup_test require_dependencies 'cucumber', :group => 'test' require_dependencies 'capybara', :group => 'test' insert_test_suite_setup CUCUMBER_SETUP, :path => "features/support/env.rb" create_file destination_root("features/add.feature"), CUCUMBER_FEATURE create_file destination_root("features/step_definitions/add_steps.rb"), CUCUMBER_STEP create_file destination_root("cucumber.yml"), CUCUMBER_YML require_dependencies 'rspec', :require => 'spec', :group => 'test' insert_test_suite_setup RSPEC_SETUP, :path => "spec/spec_helper.rb" create_file destination_root("spec/spec.rake"), RSPEC_RAKE end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
padrino-gen-0.9.10 | lib/padrino-gen/generators/components/tests/cucumber.rb |