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 'gherkin/gherkin' | |
| require 'gherkin/dialect' | |
| test_dialects = JSON.parse(File.open('test_languages.json', 'r:UTF-8').read) | |
| Gherkin::DIALECTS.merge!(test_dialects) | |
| source_text = File.read('something_to_parse.feature') | |
| result = Gherkin::Gherkin.from_source('junk_file_name', source_text, {default_dialect: 'cm-test'}).to_a | |
| puts "messages returned: #{result.count}" |
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
| When(/^whatever we have too much of in the back room:$/) do |table| | |
| $stdout.puts "starting table:\n#{table}" | |
| $stdout.puts "id: #{table.rows_hash.object_id}" | |
| @todays_sauce = ['ketchup', 'mustard', 'vinegar', 'mayo', 'lard'].sample | |
| table.rows_hash['recipe'].sub!('<sauce of the day>', @todays_sauce) | |
| @recipe = table.rows_hash['recipe'] | |
| $stdout.puts "ending table:\n#{table}" |
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
| Feature: | |
| Scenario: test 1 | |
| * a step | |
| * an ambiguous step | |
| Scenario: test 2 | |
| * step 1 | |
| * step 2 |
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 'cql' | |
| # Model your suite | |
| path_to_test_suite_directory = File.dirname(__FILE__) | |
| suite_model = CQL::Repository.new(path_to_test_suite_directory) | |
| # Gather the first scenario of every feature | |
| results = suite_model.query do | |
| select :model |
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
| Feature: Testing an asynchronous thing | |
| @async @batch_1 | |
| Scenario: Some big batch process | |
| Given some stuff is set up | |
| When the thing happens | |
| Then it worked | |
| @async @batch_2 | |
| Scenario: Another big batch process |
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
| And(/^do a thing$/) do | |
| foo = 'a' | |
| puts foo # Should output 'a' | |
| foo.upcase! | |
| puts foo # Should output 'A' | |
| foo = 'b' | |
| puts foo # Should output 'b' | |
| 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
| Feature: Feature 1 | |
| Scenario: A normal test | |
| * foo | |
| @Random(50) | |
| Scenario Outline: | |
| * foo | |
| Examples: | |
| | values | |
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_relative '../../unique_test_case_tagger' | |
| DEFAULT_FEATURE_FILE_NAME = 'test_feature' | |
| DEFAULT_FILE_DIRECTORY = "#{File.dirname(__FILE__)}/../temp_files" | |
| Before do | |
| @default_feature_file_name = DEFAULT_FEATURE_FILE_NAME | |
| @default_file_directory = DEFAULT_FILE_DIRECTORY |
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 'fileutils' | |
| require 'cucumber_analytics' | |
| require 'cuke_modeler' | |
| require 'cql' | |
| require 'cql/model_dsl' | |
| # Project structure setup | |
| your_location_here = "#{File.dirname(__FILE__)}/.." | |
| feature_directory = "#{your_location_here}/features" |
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 CukeSniffer | |
| module RuleConfig | |
| FATAL = 100 #will prevent suite from executing properly | |
| ERROR = 25 #will cause problem with debugging | |
| WARNING = 10 #readibility/misuse of cucumber | |
| INFO = 1 #Small improvements that can be made | |
| OUR_RULES = { | |
| :something_wrong => { |
NewerOlder