Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: cucumber/cucumber-js
...
head fork: cucumber/cucumber-js
  • 19 commits
  • 48 files changed
  • 0 commit comments
  • 1 contributor
Showing with 180 additions and 95 deletions.
  1. +3 −3 .gitmodules
  2. +1 −2  .npmignore
  3. +5 −1 .travis.yml
  4. +1 −1  Gemfile
  5. +19 −24 Gemfile.lock
  6. +33 −0 History.md
  7. +7 −7 README.md
  8. +0 −1  features/cucumber-features
  9. +1 −0  features/cucumber-tck
  10. +39 −4 features/step_definitions/cucumber_steps.js
  11. +8 −0 features/step_definitions/cucumber_world.js
  12. +2 −1  lib/cucumber/listener/progress_formatter.js
  13. +12 −12 package.json
  14. +1 −1  spec/cucumber/ast/background_spec.js
  15. +1 −1  spec/cucumber/ast/data_table/row_spec.js
  16. +1 −1  spec/cucumber/ast/data_table_spec.js
  17. +1 −1  spec/cucumber/ast/doc_string_spec.js
  18. +1 −1  spec/cucumber/ast/feature_spec.js
  19. +1 −1  spec/cucumber/ast/features_spec.js
  20. +1 −1  spec/cucumber/ast/scenario_spec.js
  21. +1 −1  spec/cucumber/ast/step_spec.js
  22. +1 −1  spec/cucumber/cli/argument_parser/feature_path_expander_spec.js
  23. +1 −1  spec/cucumber/cli/argument_parser/path_expander_spec.js
  24. +1 −1  spec/cucumber/cli/argument_parser/support_code_path_expander_spec.js
  25. +2 −2 spec/cucumber/cli/argument_parser_spec.js
  26. +1 −1  spec/cucumber/cli/configuration_spec.js
  27. +1 −1  spec/cucumber/cli/feature_source_loader_spec.js
  28. +1 −1  spec/cucumber/cli/support_code_loader_spec.js
  29. +1 −1  spec/cucumber/cli_spec.js
  30. +9 −1 spec/cucumber/listener/progress_formatter_spec.js
  31. +1 −1  spec/cucumber/parser_spec.js
  32. +1 −1  spec/cucumber/runtime/ast_tree_walker/event_spec.js
  33. +1 −1  spec/cucumber/runtime/ast_tree_walker_spec.js
  34. +1 −1  spec/cucumber/runtime/failed_step_result_spec.js
  35. +1 −1  spec/cucumber/runtime/pending_step_result_spec.js
  36. +1 −1  spec/cucumber/runtime/successful_step_result_spec.js
  37. +1 −1  spec/cucumber/runtime_spec.js
  38. +1 −1  spec/cucumber/support_code/library_spec.js
  39. +1 −1  spec/cucumber/support_code/step_definition_snippet_builder_spec.js
  40. +1 −1  spec/cucumber/support_code/step_definition_spec.js
  41. +1 −1  spec/cucumber/support_code/world_constructor_spec.js
  42. +1 −1  spec/cucumber/type/collection_spec.js
  43. +2 −2 spec/cucumber/type/hash_data_table_spec.js
  44. +2 −2 spec/cucumber/util/arguments_spec.js
  45. +1 −1  spec/cucumber/util/reg_exp_spec.js
  46. +1 −1  spec/cucumber/volatile_configuration_spec.js
  47. +1 −1  spec/cucumber_spec.js
  48. +4 −2 spec/support/spec_helper.js
View
6 .gitmodules
@@ -1,3 +1,3 @@
-[submodule "features/cucumber-features"]
- path = features/cucumber-features
- url = git://github.com/cucumber/cucumber-features.git
+[submodule "features/cucumber-tck"]
+ path = features/cucumber-tck
+ url = git://github.com/cucumber/cucumber-tck.git
View
3  .npmignore
@@ -5,5 +5,4 @@ node_modules
.rvmrc
doc/
tmp/
-example/
-Procfile
+Procfile
View
6 .travis.yml
@@ -2,6 +2,10 @@ rvm: "1.9.2"
before_script: "git submodule update --init && npm install"
script: "rake"
+node_js:
+ - 0.4
+ - 0.6
+
branches:
only:
- master
@@ -10,4 +14,4 @@ notifications:
email:
- jb@jbpros.com
irc:
- - "irc.freenode.org#cucumber.js"
+ - "irc.freenode.org#cucumber.js"
View
2  Gemfile
@@ -1,7 +1,7 @@
source :rubygems
group :test do
- gem "aruba", "0.4.6"
+ gem "aruba", "0.4.7"
end
group :dev do
View
43 Gemfile.lock
@@ -1,48 +1,43 @@
GEM
remote: http://rubygems.org/
specs:
- aruba (0.4.6)
- bcat (>= 0.6.1)
- childprocess (>= 0.2.0)
- cucumber (>= 1.0.2)
- rdiscount (>= 1.6.8)
- rspec (>= 2.6.0)
- bcat (0.6.2)
- rack (~> 1.0)
+ aruba (0.4.7)
+ childprocess (>= 0.2.2)
+ cucumber (>= 1.1.1)
+ ffi (= 1.0.9)
+ rspec (>= 2.7.0)
builder (3.0.0)
- childprocess (0.2.2)
+ childprocess (0.2.3)
ffi (~> 1.0.6)
- cucumber (1.1.0)
+ cucumber (1.1.3)
builder (>= 2.1.2)
diff-lcs (>= 1.1.2)
- gherkin (~> 2.5.0)
+ gherkin (~> 2.6.7)
json (>= 1.4.6)
term-ansicolor (>= 1.0.6)
diff-lcs (1.1.3)
ffi (1.0.9)
- gherkin (2.5.1)
+ gherkin (2.6.8)
json (>= 1.4.6)
guard (0.8.2)
thor (~> 0.14.6)
guard-jasmine-node (0.0.5)
guard (>= 0.4)
- json (1.6.1)
- rack (1.3.3)
- rdiscount (1.6.8)
- rspec (2.6.0)
- rspec-core (~> 2.6.0)
- rspec-expectations (~> 2.6.0)
- rspec-mocks (~> 2.6.0)
- rspec-core (2.6.4)
- rspec-expectations (2.6.0)
+ json (1.6.3)
+ rspec (2.7.0)
+ rspec-core (~> 2.7.0)
+ rspec-expectations (~> 2.7.0)
+ rspec-mocks (~> 2.7.0)
+ rspec-core (2.7.1)
+ rspec-expectations (2.7.0)
diff-lcs (~> 1.1.2)
- rspec-mocks (2.6.0)
- term-ansicolor (1.0.6)
+ rspec-mocks (2.7.0)
+ term-ansicolor (1.0.7)
thor (0.14.6)
PLATFORMS
ruby
DEPENDENCIES
- aruba (= 0.4.6)
+ aruba (= 0.4.7)
guard-jasmine-node (= 0.0.5)
View
33 History.md
@@ -2,6 +2,39 @@
## [v0.2](https://github.com/cucumber/cucumber-js/compare/v0.1.5...master)
+
+
+### [v0.2.3](https://github.com/cucumber/cucumber-js/compare/v0.2.2...v0.2.3)
+
+#### New features
+
+* Add support for Node 0.6 (Julien Biezemans)
+
+#### Fixes
+
+* Prevent the same step definition snippet from being suggested twice (Julien Biezemans)
+
+#### Internals and tests
+
+* Don't make NPM ignore example/ anymore
+* Bump cucumber-features (Julien Biezemans)
+* Use non-deprecated "url" key instead of "web" in NPM manifest (Julien Biezemans)
+* Add JS step definitions related to data table scenarios (Julien Biezemans)
+* Move from cucumber-features to cucumber-tck (Julien Biezemans)
+* Bump Gherkin (Julien Biezemans)
+* Bump jasmine-node (Julien Biezemans)
+* Bump connect (Julien Biezemans)
+* Fix Travis build (Julien Biezemans)
+* Bump browserify (Julien Biezemans)
+* Bump nopt (Julien Biezemans)
+* Bump underscore (Julien Biezemans)
+* Bump underscore.string (Julien Biezemans)
+* Bump rimraf (Julien Biezemans)
+* Bump mkdirp (Julien Biezemans)
+* Bump Aruba (Julien Biezemans)
+
+
+
### [v0.2.2](https://github.com/cucumber/cucumber-js/compare/v0.2.1...v0.2.2)
#### New features
View
14 README.md
@@ -13,7 +13,7 @@ It still needs a lot of work. Only a few feature elements are supported at the m
### Works on
-* Node.js 0.4.7, 0.4.8, 0.5.0-pre
+* Node.js 0.4, 0.5, 0.6
* Google Chrome 13.0.772.0 (dev)
* Firefox 4.0.1
* Safari 5.0.5
@@ -40,21 +40,21 @@ Then go to [localhost:9797](http://localhost:9797/).
### Features & documentation
-There is a common set of features shared between all cucumber implementations. Find more on the [cucumber-features](http://github.com/cucumber/cucumber-features) repository.
+There is a common set of features shared by all cucumber implementations. It's called the *Technology Compatibility Kit* or *TCK*. Find more on the [cucumber-tck](http://github.com/cucumber/cucumber-tck) repository.
The official way of running them is through Cucumber-ruby and Aruba. Ruby and Bundler are required for this to work.
$ git submodule update --init
$ bundle
- $ rm -rf doc; ARUBA_REPORT_DIR=doc cucumber features/cucumber-features -r features
+ $ rm -rf doc; ARUBA_REPORT_DIR=doc cucumber features/cucumber-tck -r features
You can then open the generated documentation:
- $ open doc/features/cucumber-features/*.html # might open a lot of files ;)
+ $ open doc/features/cucumber-tck/*.html # might open a lot of files ;)
In addition to that, Cucumber.js is able to run the features for itself too:
- $ ./bin/cucumber.js features/cucumber-features -r features
+ $ ./bin/cucumber.js features/cucumber-tck -r features
There are a few other Cucumber.js-dependent features. Execute everything:
@@ -76,5 +76,5 @@ You can display debug messages by setting the DEBUG_LEVEL environment variable.
It even works with Aruba:
- $ rm -rf doc; DEBUG_LEVEL=5 ARUBA_REPORT_DIR=doc cucumber features/cucumber-features -r features
- $ open doc/features/cucumber-features/*.html # you'll see debug messages in Aruba-generated docs
+ $ rm -rf doc; DEBUG_LEVEL=5 ARUBA_REPORT_DIR=doc cucumber features/cucumber-tck -r features
+ $ open doc/features/cucumber-tck/*.html # you'll see debug messages in Aruba-generated docs
1  features/cucumber-features
@@ -1 +0,0 @@
-Subproject commit 8102227d86b4c3a9666fee5cf26796850bab0bb1
1  features/cucumber-tck
@@ -0,0 +1 @@
+Subproject commit 996c140d8ca664f9176998ef77cb9ca99ca9b897
View
43 features/step_definitions/cucumber_steps.js
@@ -1,7 +1,7 @@
var cucumberSteps = function() {
- var Given = When = Then = this.defineStep;
-
- this.World = require('./cucumber_world');
+ var Given = When = Then = this.defineStep;
+ var World = require('./cucumber_world');
+ this.World = World;
Given(/^a scenario with:$/, function(steps, callback) {
this.featureSource += "Feature: A feature\n";
@@ -47,6 +47,22 @@ var cucumberSteps = function() {
callback();
});
+ Given(/^the step "([^"]*)" has a passing mapping that receives a data table$/, function(stepName, callback) {
+ this.stepDefinitions += "Given(/^" + stepName + "$/, function(dataTable, callback) {\
+ world.dataTableLog = dataTable.raw();\
+ callback();\
+});";
+ callback();
+ });
+
+ Given(/^the following data table in a step:$/, function(dataTable, callback) {
+ this.featureSource += "Feature:\n";
+ this.featureSource += " Scenario:\n";
+ this.featureSource += " When a step with data table:\n"
+ this.featureSource += dataTable.replace(/^/gm, ' ');
+ callback();
+ });
+
When(/^Cucumber executes the scenario$/, function(callback) {
this.runFeature(callback);
});
@@ -61,6 +77,14 @@ var cucumberSteps = function() {
this.runFeatureWithSupportCodeSource(supportCode, callback);
});
+ When(/^the data table is passed to a step mapping that converts it to key\/value pairs$/, function(callback) {
+ this.stepDefinitions += "When(/^a step with data table:$/, function(dataTable, callback) {\
+ world.dataTableLog = dataTable.hashes();\
+ callback();\
+});\n";
+ this.runFeature(callback);
+ });
+
Then(/^the scenario passes$/, function(callback) {
this.assertPassedScenario();
callback();
@@ -96,7 +120,6 @@ var cucumberSteps = function() {
callback();
});
-
Then(/^the step "([^"]*)" is skipped$/, function(stepName, callback) {
this.assertSkippedStep(stepName);
callback();
@@ -111,5 +134,17 @@ var cucumberSteps = function() {
this.assertFailureMessage(message);
callback();
});
+
+ Then(/^the received data table array equals the following:$/, function(expectedDataTableJSON, callback) {
+ var expectedDataTable = JSON.parse(expectedDataTableJSON);
+ this.assertEqual(expectedDataTable, World.mostRecentInstance.dataTableLog);
+ callback();
+ });
+
+ Then(/^the data table is converted to the following:$/, function(expectedDataTableJSON, callback) {
+ var expectedDataTable = JSON.parse(expectedDataTableJSON);
+ this.assertEqual(expectedDataTable, World.mostRecentInstance.dataTableLog);
+ callback();
+ });
};
module.exports = cucumberSteps;
View
8 features/step_definitions/cucumber_world.js
@@ -4,6 +4,7 @@ var CucumberWorld = function() {
this.stepDefinitions = "";
this.runOutput = "";
this.runSucceeded = false;
+ CucumberWorld.mostRecentInstance = this;
};
var proto = CucumberWorld.prototype;
@@ -108,4 +109,11 @@ proto.assertNoPartialOutput = function assertNoPartialOutput(expected, actual) {
throw(new Error("Expected:\n\"" + actual + "\"\nnot to match:\n\"" + expected + "\""));
}
+proto.assertEqual = function assertRawDataTable(expected, actual) {
+ var expectedJSON = JSON.stringify(expected);
+ var actualJSON = JSON.stringify(actual);
+ if (actualJSON != expectedJSON)
+ throw(new Error("Expected:\n\"" + actualJSON + "\"\nto match:\n\"" + expectedJSON + "\""));
+}
+
module.exports = CucumberWorld;
View
3  lib/cucumber/listener/progress_formatter.js
@@ -171,7 +171,8 @@ var ProgressFormatter = function(options) {
},
appendStringToUndefinedStepLogBuffer: function appendStringToUndefinedStepLogBuffer(string) {
- undefinedStepLogBuffer += string + "\n";
+ if (undefinedStepLogBuffer.indexOf(string) == -1)
+ undefinedStepLogBuffer += string + "\n";
},
getFailedScenarioLogBuffer: function getFailedScenarioLogBuffer() {
View
24 package.json
@@ -1,7 +1,7 @@
{ "name" : "cucumber"
, "description" : "The official JavaScript implementation of Cucumber."
, "keywords" : [ "testing", "bdd", "cucumber", "gherkin", "tests" ]
-, "version" : "0.2.2"
+, "version" : "0.2.3"
, "homepage" : "http://github.com/cucumber/cucumber-js"
, "author" : "Julien Biezemans <jb@jbpros.com> (http://jbpros.net)"
, "contributors" : [
@@ -16,21 +16,21 @@
}
, "bugs" :
{ "mail" : "cukes@googlegroups.com"
- , "web" : "http://github.com/cucumber/cucumber-js/issues"
+ , "url" : "http://github.com/cucumber/cucumber-js/issues"
}
, "directories" : { "lib" : "./lib" }
, "main" : "./lib/cucumber"
-, "engines" : { "node" : "0.4 || 0.5" }
+, "engines" : { "node" : "0.4 || 0.5 || 0.6" }
, "dependencies" :
- { "gherkin" : "2.5.1"
- , "jasmine-node" : "1.0.9"
- , "connect" : "1.6.0"
- , "browserify" : "1.5.0"
- , "nopt" : "1.0.6"
- , "underscore" : "1.1.7"
- , "underscore.string" : "1.1.6"
- , "rimraf" : "1.0.4"
- , "mkdirp" : "0.0.6"
+ { "gherkin" : "2.6.8"
+ , "jasmine-node" : "1.0.13"
+ , "connect" : "1.8.1"
+ , "browserify" : "1.8.1"
+ , "nopt" : "1.0.10"
+ , "underscore" : "1.2.2"
+ , "underscore.string" : "2.0.0"
+ , "rimraf" : "1.0.8"
+ , "mkdirp" : "0.2.1"
, "cucumber-html": "0.2.0"
, "findit": "0.1.1"
, "coffee-script": "1.1.2"
View
2  spec/cucumber/ast/background_spec.js
@@ -1,7 +1,7 @@
require('../../support/spec_helper');
describe("Cucumber.Ast.Background", function() {
- var Cucumber = require('cucumber');
+ var Cucumber = requireLib('cucumber');
var steps;
var background, keyword, name, description, line, lastStep;
View
2  spec/cucumber/ast/data_table/row_spec.js
@@ -1,7 +1,7 @@
require('../../../support/spec_helper');
describe("Cucumber.Ast.Feature", function() {
- var Cucumber = require('cucumber');
+ var Cucumber = requireLib('cucumber');
var row, cells, line;
View
2  spec/cucumber/ast/data_table_spec.js
@@ -1,7 +1,7 @@
require('../../support/spec_helper');
describe("Cucumber.Ast.DataTable", function() {
- var Cucumber = require('cucumber');
+ var Cucumber = requireLib('cucumber');
var dataTable, rows;
View
2  spec/cucumber/ast/doc_string_spec.js
@@ -1,7 +1,7 @@
require('../../support/spec_helper');
describe("Cucumber.Ast.DocString", function() {
- var Cucumber = require('cucumber');
+ var Cucumber = requireLib('cucumber');
var docString, contents, line;
beforeEach(function() {
View
2  spec/cucumber/ast/feature_spec.js
@@ -1,7 +1,7 @@
require('../../support/spec_helper');
describe("Cucumber.Ast.Feature", function() {
- var Cucumber = require('cucumber');
+ var Cucumber = requireLib('cucumber');
var scenarioCollection, lastScenario;
var feature, keyword, name, line;
View
2  spec/cucumber/ast/features_spec.js
@@ -1,7 +1,7 @@
require('../../support/spec_helper');
describe("Cucumber.Ast.Features", function() {
- var Cucumber = require('cucumber');
+ var Cucumber = requireLib('cucumber');
var featureCollection, lastFeature;
var features;
View
2  spec/cucumber/ast/scenario_spec.js
@@ -1,7 +1,7 @@
require('../../support/spec_helper');
describe("Cucumber.Ast.Scenario", function() {
- var Cucumber = require('cucumber');
+ var Cucumber = requireLib('cucumber');
var steps;
var scenario, keyword, name, description, line, background, lastStep;
View
2  spec/cucumber/ast/step_spec.js
@@ -1,7 +1,7 @@
require('../../support/spec_helper');
describe("Cucumber.Ast.Step", function() {
- var Cucumber = require('cucumber');
+ var Cucumber = requireLib('cucumber');
var step, keyword, name, line, previousStep;
var docString, dataTable;
View
2  spec/cucumber/cli/argument_parser/feature_path_expander_spec.js
@@ -1,7 +1,7 @@
require('../../../support/spec_helper');
describe("Cucumber.Cli.ArgumentParser.FeaturePathExpander", function() {
- var Cucumber = require('cucumber');
+ var Cucumber = requireLib('cucumber');
var FeaturePathExpander = Cucumber.Cli.ArgumentParser.FeaturePathExpander;
var PathExpander = Cucumber.Cli.ArgumentParser.PathExpander;
View
2  spec/cucumber/cli/argument_parser/path_expander_spec.js
@@ -1,7 +1,7 @@
require('../../../support/spec_helper');
describe("Cucumber.Cli.ArgumentParser.PathExpander", function() {
- var PathExpander = require('cucumber').Cli.ArgumentParser.PathExpander;
+ var PathExpander = requireLib('cucumber').Cli.ArgumentParser.PathExpander;
describe("expandPathsWithRegexp", function() {
var _ = require('underscore');
View
2  spec/cucumber/cli/argument_parser/support_code_path_expander_spec.js
@@ -1,7 +1,7 @@
require('../../../support/spec_helper');
describe("Cucumber.Cli.ArgumentParser.SupportCodePathExpander", function() {
- var Cucumber = require('cucumber');
+ var Cucumber = requireLib('cucumber');
var SupportCodePathExpander = Cucumber.Cli.ArgumentParser.SupportCodePathExpander;
var PathExpander = Cucumber.Cli.ArgumentParser.PathExpander;
View
4 spec/cucumber/cli/argument_parser_spec.js
@@ -1,7 +1,7 @@
require('../../support/spec_helper');
describe("Cucumber.Cli.ArgumentParser", function() {
- var Cucumber = require('cucumber');
+ var Cucumber = requireLib('cucumber');
var path = require('path');
var nopt;
@@ -76,7 +76,7 @@ describe("Cucumber.Cli.ArgumentParser", function() {
});
describe("getFeatureFilePaths()", function() {
- var Cucumber = require('cucumber');
+ var Cucumber = requireLib('cucumber');
var unexpandedFeaturePaths;
var expandedFeaturePaths;
View
2  spec/cucumber/cli/configuration_spec.js
@@ -2,7 +2,7 @@ require('../../support/spec_helper');
require('../../support/configurations_shared_examples.js');
describe("Cucumber.Cli.Configuration", function() {
- var Cucumber = require('cucumber');
+ var Cucumber = requireLib('cucumber');
var argv, configuration;
var argumentParser;
View
2  spec/cucumber/cli/feature_source_loader_spec.js
@@ -1,7 +1,7 @@
require('../../support/spec_helper');
describe("Cucumber.Cli.FeatureSourceLoader", function() {
- var Cucumber = require('cucumber');
+ var Cucumber = requireLib('cucumber');
var featureSourceLoader, featureFilePaths;
View
2  spec/cucumber/cli/support_code_loader_spec.js
@@ -1,7 +1,7 @@
require('../../support/spec_helper');
describe("Cucumber.Cli.SupportCodeLoader", function() {
- var Cucumber = require('cucumber');
+ var Cucumber = requireLib('cucumber');
var fs = require('fs');
var supportCodeLoader, supportCodeFilePaths, primeSupportCodeFilePaths, secondarySupportCodeFilePaths;
View
2  spec/cucumber/cli_spec.js
@@ -1,7 +1,7 @@
require('../support/spec_helper');
describe("Cucumber.Cli", function() {
- var Cucumber = require('cucumber');
+ var Cucumber = requireLib('cucumber');
var cli, argv;
View
10 spec/cucumber/listener/progress_formatter_spec.js
@@ -1,7 +1,7 @@
require('../../support/spec_helper');
describe("Cucumber.Listener.ProgressFormatter", function() {
- var Cucumber = require('cucumber');
+ var Cucumber = requireLib('cucumber');
var listener, failedStepResults;
beforeEach(function() {
@@ -721,6 +721,14 @@ describe("Cucumber.Listener.ProgressFormatter", function() {
});
});
+ describe("appendStringToUndefinedStepLogBuffer() [getUndefinedStepLogBuffer()]", function() {
+ it("does not log the same string twice", function() {
+ listener.appendStringToUndefinedStepLogBuffer("abcdef");
+ listener.appendStringToUndefinedStepLogBuffer("abcdef");
+ expect(listener.getUndefinedStepLogBuffer()).toBe("abcdef\n");
+ });
+ });
+
describe("logSummary()", function() {
var scenarioCount, passedScenarioCount, failedScenarioCount;
var stepCount, passedStepCount;
View
2  spec/cucumber/parser_spec.js
@@ -1,7 +1,7 @@
require('../support/spec_helper');
describe("Cucumber.Parser", function() {
- var Cucumber = require('cucumber');
+ var Cucumber = requireLib('cucumber');
var parser, featureSources;
var features;
View
2  spec/cucumber/runtime/ast_tree_walker/event_spec.js
@@ -1,7 +1,7 @@
require('../../../support/spec_helper');
describe("Cucumber.Runtime.AstTreeWalker.Event", function() {
- var Cucumber = require('cucumber');
+ var Cucumber = requireLib('cucumber');
describe("non-instance method", function() {
});
View
2  spec/cucumber/runtime/ast_tree_walker_spec.js
@@ -1,7 +1,7 @@
require('../../support/spec_helper');
describe("Cucumber.Runtime.AstTreeWalker", function() {
- var Cucumber = require('cucumber');
+ var Cucumber = requireLib('cucumber');
var treeWalker, features, supportCodeLibrary, listeners;
beforeEach(function() {
View
2  spec/cucumber/runtime/failed_step_result_spec.js
@@ -1,7 +1,7 @@
require('../../support/spec_helper');
describe("Cucumber.Runtime.FailedStepResult", function() {
- var Cucumber = require('cucumber');
+ var Cucumber = requireLib('cucumber');
var stepResult, failureException;
beforeEach(function() {
View
2  spec/cucumber/runtime/pending_step_result_spec.js
@@ -1,7 +1,7 @@
require('../../support/spec_helper');
describe("Cucumber.Runtime.PendingStepResult", function() {
- var Cucumber = require('cucumber');
+ var Cucumber = requireLib('cucumber');
var stepResult;
beforeEach(function() {
View
2  spec/cucumber/runtime/successful_step_result_spec.js
@@ -1,7 +1,7 @@
require('../../support/spec_helper');
describe("Cucumber.Runtime.SuccessfulStepResult", function() {
- var Cucumber = require('cucumber');
+ var Cucumber = requireLib('cucumber');
var stepResult;
beforeEach(function() {
View
2  spec/cucumber/runtime_spec.js
@@ -1,7 +1,7 @@
require('../support/spec_helper');
describe("Cucumber.Runtime", function() {
- var Cucumber = require('cucumber');
+ var Cucumber = requireLib('cucumber');
var configuration;
var runtime;
var supportCodeLibrary, listeners;
View
2  spec/cucumber/support_code/library_spec.js
@@ -1,7 +1,7 @@
require('../../support/spec_helper');
describe("Cucumber.SupportCode.Library", function() {
- var Cucumber = require('cucumber');
+ var Cucumber = requireLib('cucumber');
var library, rawSupportCode;
var stepDefinitionCollection;
var worldConstructor;
View
2  spec/cucumber/support_code/step_definition_snippet_builder_spec.js
@@ -2,7 +2,7 @@ require('../../support/spec_helper');
describe("Cucumber.SupportCode.StepDefinitionSnippetBuilder", function() {
var _s = require('underscore.string');
- var Cucumber = require('cucumber');
+ var Cucumber = requireLib('cucumber');
var StepDefinitionSnippetBuilder = Cucumber.SupportCode.StepDefinitionSnippetBuilder;
var snippetBuilder, step;
View
2  spec/cucumber/support_code/step_definition_spec.js
@@ -1,7 +1,7 @@
require('../../support/spec_helper');
describe("Cucumber.SupportCode.StepDefinition", function() {
- var Cucumber = require('cucumber');
+ var Cucumber = requireLib('cucumber');
var stepDefinition, stepRegexp, stepDefinitionCode;
beforeEach(function() {
View
2  spec/cucumber/support_code/world_constructor_spec.js
@@ -1,7 +1,7 @@
require('../../support/spec_helper');
describe("Cucumber.SupportCode.WorldConstructor", function() {
- var Cucumber = require('cucumber');
+ var Cucumber = requireLib('cucumber');
it("returns a function", function() {
worldConstructor = Cucumber.SupportCode.WorldConstructor();
View
2  spec/cucumber/type/collection_spec.js
@@ -1,7 +1,7 @@
require('../../support/spec_helper');
describe("Cucumber.Type.Collection", function() {
- var Cucumber = require('cucumber');
+ var Cucumber = requireLib('cucumber');
var collection, itemArray;
beforeEach(function() {
View
4 spec/cucumber/type/hash_data_table_spec.js
@@ -1,7 +1,7 @@
require('../../support/spec_helper');
describe("Cucumber.Type.HashDataTable", function() {
- var Cucumber = require('cucumber');
+ var Cucumber = requireLib('cucumber');
var hashDataTable, rawArray;
@@ -94,4 +94,4 @@ describe("Cucumber.Type.HashDataTable", function() {
expect(actual).toEqual(expected);
});
});
-});
+});
View
4 spec/cucumber/util/arguments_spec.js
@@ -1,7 +1,7 @@
require('../../support/spec_helper');
describe("Cucumber.Util.Arguments", function() {
- var Cucumber = require('cucumber');
+ var Cucumber = requireLib('cucumber');
var argumentsObject, thisDuringSlice, argumentsArray;
beforeEach(function() {
@@ -22,4 +22,4 @@ describe("Cucumber.Util.Arguments", function() {
it("returns the array created by slice()", function() {
expect(Cucumber.Util.Arguments(argumentsObject)).toBe(argumentsArray);
});
-});
+});
View
2  spec/cucumber/util/reg_exp_spec.js
@@ -1,7 +1,7 @@
require('../../support/spec_helper');
describe("Cucumber.Util.RegExp", function() {
- var Cucumber = require('cucumber');
+ var Cucumber = requireLib('cucumber');
describe("escapeString()", function() {
var escapeString = Cucumber.Util.RegExp.escapeString;
View
2  spec/cucumber/volatile_configuration_spec.js
@@ -2,7 +2,7 @@ require('../support/spec_helper');
require('../support/configurations_shared_examples.js');
describe("Cucumber.VolatileConfiguration", function() {
- var Cucumber = require('cucumber');
+ var Cucumber = requireLib('cucumber');
var featureSource, supportCodeInitializer, configuration;
var supportCodeLibrary;
View
2  spec/cucumber_spec.js
@@ -1,7 +1,7 @@
require('./support/spec_helper');
describe("Cucumber", function() {
- var Cucumber = require('cucumber');
+ var Cucumber = requireLib('cucumber');
var featureSource, supportCodeInitializer, configuration;
View
6 spec/support/spec_helper.js
@@ -1,5 +1,3 @@
-require.paths.unshift(__dirname + '/../../lib');
-
beforeEach(function() {
this.addMatchers({
toBeAFunction: function() { return typeof(this.actual) == 'function'; },
@@ -122,6 +120,10 @@ require.extensions['.js'] = function (obj, path) {
}
}
+requireLib = function(modulePath) {
+ return require('../../lib/' + modulePath);
+};
+
afterEach(function() {
for (var path in moduleSpies) {
delete moduleSpies[path];

No commit comments for this range

Something went wrong with that request. Please try again.