From d42cfd94b619007e8bd7c102851d60108324262b Mon Sep 17 00:00:00 2001 From: David Dooling Date: Thu, 16 Mar 2017 15:29:39 -0500 Subject: [PATCH] Ensure test projects have a name When creating the project artifact for testing, give it a name. Clean up links in the change log. Fixes #436 --- CHANGELOG.md | 96 ++++++++++++------- .../project/ProjectScenarioWorld.scala | 2 +- .../rug/test/gherkin/GherkinReaderTest.scala | 44 +++++---- .../gherkin/project/ProjectTestTargets.scala | 7 ++ 4 files changed, 90 insertions(+), 59 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a02487325..3202bb6f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,9 +19,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Changed -- **BREAKING** Python Requirements old type has been removed as it was - not matching the current programming model. It will be moved to its own - project. https://github.com/atomist/rug/pull/434 +- **BREAKING** Python Requirements old type has been removed as it + was not matching the current programming model. It will be moved + to its own project. [#434][434] - Improve duplicate removal in expression engine - Make TypeScript test stubs addressable (to help with deduping) - Correct some usages of TreeNode where GraphNode could be used @@ -29,6 +29,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/). additional `projectName` parameter between the generator and its parameters. +[434]: https://github.com/atomist/rug/pull/434 + +### Fixed + +- Editor test project objects have a name [#436][436] + +[436]: https://github.com/atomist/rug/issues/436 + ## [0.14.0] - 2017-03-15 [0.14.0]: https://github.com/atomist/rug/compare/0.13.0...0.14.0 @@ -119,19 +127,21 @@ Valentine release ### Fixed -- Elm parser failed on files with two multiline comments - https://github.com/atomist/rug/issues/268 +- Elm parser failed on files with two multiline comments [#268][268] - Raise an `InvalidRugTestScenarioName` when a Rug test scenario is missing a name #71 - Implicit DLS parameters (from `uses`) are no longer duplicate if multiple editors declare the same parameter. The first one is - chosen. https://github.com/atomist/rug/issues/258 + chosen [#258][258] - Ensure TS parameters are required by default, and ensure defaults - are applied before validation: - https://github.com/atomist/rug/issues/224 + are applied before validation [#224][224] - Changed how descendants were found and processed in tree expressions which fixed two pendingUntilFixed tests +[268]: https://github.com/atomist/rug/issues/268 +[258]: https://github.com/atomist/rug/issues/258 +[224]: https://github.com/atomist/rug/issues/224 + ### Changed - Upgrade TS compiler to 2.1.5 @@ -157,15 +167,19 @@ Valentine release maintain the Json is was generated from - Add correlationId to Message, allows handler to define how Messages are correlated -- Support for @parameter TS class field decorators as per - https://github.com/atomist/rug/issues/229 -- Support for a new TS (JS) Handler programming model as per - https://github.com/atomist/rug/issues/105 +- Support for @parameter TS class field decorators as + per [#229][229] +- Support for a new TS (JS) Handler programming model as + per [#105][105] - Support for Type extensions/TreeNode written in TypeScript as - per https://github.com/atomist/rug/issues/214 + per [#214][214] - Generators are now declared with the `generator` keyword - Optional predicates in tree expressions +[229]: https://github.com/atomist/rug/issues/229 +[105]: https://github.com/atomist/rug/issues/105 +[214]: https://github.com/atomist/rug/issues/214 + ### Fixed - LinkedJsonTreeDeserializer now properly returns string values @@ -173,23 +187,22 @@ Valentine release is updated - TS generators are now passed project name as second argument as per TS contract -- Retain all changes from an editor - https://github.com/atomist/rug/issues/199 +- Retain all changes from an editor [#199][199] - Yml type can now be instantiated from ProjectMutableView, - DirectoryMutableView, and FileMutableView, - https://github.com/atomist/rug/issues/250 + DirectoryMutableView, and FileMutableView [#250][250] - Handle YAML files with multiple documents, but only first is parsed and addressable. +[199]: https://github.com/atomist/rug/issues/199 +[250]: https://github.com/atomist/rug/issues/250 + ### Changed - **BREAKING** `TreeNode.nodeType` renamed to `TreeNode.nodeTags` -- We now create a new JS rug for each thread for safety. - https://github.com/atomist/rug/issues/78 +- We now create a new JS rug for each thread for safety [#78][78] - **BREAKING** all JS based Rugs must export (a la Common-JS) vars implementing the associated interfaces. Previously we scanned for all top level vars. -- **BREAKING** Remove Executor support from Rug DSL as per: - https://github.com/atomist/rug/issues/206 +- **BREAKING** Remove Executor support from Rug DSL as per [#206][206] - TypeScript editors now return void. Use the new `ProjectMutableView` `describeChange` method to add any comments about the working of your editor. @@ -206,6 +219,9 @@ Valentine release allow-warnings` profile to have the old behavior. The Travis CI build uses the allow-warnings profile. +[78]: https://github.com/atomist/rug/issues/78 +[206]: https://github.com/atomist/rug/issues/206 + ### Deprecated - The `@generator` has been deprecated in favor of the `generator` @@ -232,17 +248,19 @@ Valentine release - Comments are removed from JS files as they are 'required', and relative imports now work correctly when 'export' is used from TS - or vars are added to the global exports var - https://github.com/atomist/rug/issues/156 + or vars are added to the global exports var [#156][156] - Generation of Rug types documentation -- minLength and maxLength now default to -1 as per Rug DSL - https://github.com/atomist/rug/issues/169 -- Allow Java annotations with properties - https://github.com/atomist/rug/issues/164 -- Default parameter values are now validated - https://github.com/atomist/rug/issues/168 -- Output parameter name when pattern fails to validate - https://github.com/atomist/rug/issues/58 +- minLength and maxLength now default to -1 as per Rug + DSL [#169][169] +- Allow Java annotations with properties [#164][164] +- Default parameter values are now validated [#168][168] +- Output parameter name when pattern fails to validate [#58][58] + +[156]: https://github.com/atomist/rug/issues/156 +[169]: https://github.com/atomist/rug/issues/169 +[164]: https://github.com/atomist/rug/issues/164 +[168]: https://github.com/atomist/rug/issues/168 +[58]: https://github.com/atomist/rug/issues/58 ### Removed @@ -261,11 +279,13 @@ TypeScripting release ### Fixed -- TS parameter tags were not being extracted - https://github.com/atomist/rug/issues/151 -- Parameters for TS editors/generators were defaulting to displayable=false. - They now default to displayable=true. - https://github.com/atomist/rug/issues/148 +- TS parameter tags were not being extracted [#151][151] +- Parameters for TS editors/generators were defaulting to + displayable=false. They now default to + displayable=true. [#148][148] + +[151]: https://github.com/atomist/rug/issues/151 +[148]: https://github.com/atomist/rug/issues/148 ## [0.8.0] - 2017-01-04 @@ -297,7 +317,9 @@ Breaking release - Double-quoted strings in Rug DSL are now interpreted similarly to Java double-quoted strings - LABEL section in files parsed by Dockerfile type did not handle - multi-line strings correctly as per https://github.com/atomist/rug/issues/140 + multi-line strings correctly as per [#140][140] + +[140]: https://github.com/atomist/rug/issues/140 ## [0.7.1] - 2016-12-19 diff --git a/src/main/scala/com/atomist/rug/test/gherkin/project/ProjectScenarioWorld.scala b/src/main/scala/com/atomist/rug/test/gherkin/project/ProjectScenarioWorld.scala index ef1160b37..8cba266ee 100644 --- a/src/main/scala/com/atomist/rug/test/gherkin/project/ProjectScenarioWorld.scala +++ b/src/main/scala/com/atomist/rug/test/gherkin/project/ProjectScenarioWorld.scala @@ -23,7 +23,7 @@ class ProjectScenarioWorld( private var editorResults: Seq[Either[Throwable, ModificationAttempt]] = Nil - val project = new ProjectMutableView(rugAs = definitions.jsc.rugAs, originalBackingObject = EmptyArtifactSource()) + val project = new ProjectMutableView(rugAs = definitions.jsc.rugAs, originalBackingObject = EmptyArtifactSource("project-scenario-world")) override def target: AnyRef = project diff --git a/src/test/scala/com/atomist/rug/test/gherkin/GherkinReaderTest.scala b/src/test/scala/com/atomist/rug/test/gherkin/GherkinReaderTest.scala index 8b7a074fd..d60b9f776 100644 --- a/src/test/scala/com/atomist/rug/test/gherkin/GherkinReaderTest.scala +++ b/src/test/scala/com/atomist/rug/test/gherkin/GherkinReaderTest.scala @@ -39,35 +39,37 @@ object GherkinReaderTest { val Simple = """ |Feature: Australian political history - | This is a test - | to demonstrate that the Gherkin DSL - | is a good fit for Rug BDD testing + | This is a test + | to demonstrate that the Gherkin DSL + | is a good fit for Rug BDD testing | - |Scenario: Australian politics, 1972-1991 - | Given an empty project - | Given a visionary leader - | When politics takes its course - | Then changes were made - | Then one edit was made - | Then the rage is maintained + | Scenario: Australian politics, 1972-1991 + | Given an empty project + | Given a visionary leader + | When politics takes its course + | Then changes were made + | Then one edit was made + | Then the rage is maintained + | Then the rage has a name """.stripMargin val TwoScenarios = """ |Feature: Do anything at all - | This is a test - | to see if - | Gherkin is a good option + | This is a test + | to see if + | Gherkin is a good option | - |Scenario: I want to parse a file - | Given a file - | When politics takes its course - | Then the rage is maintained + | Scenario: I want to parse a file + | Given a file + | When politics takes its course + | Then the rage is maintained + | Then the rage has a name | - |Scenario: I want to go home early - | Given a file - | When politics takes its course - | Then everything's done + | Scenario: I want to go home early + | Given a file + | When politics takes its course + | Then everything's done """.stripMargin val SimpleFeatureFile = StringFileArtifact(".atomist/tests/project/Simple.feature", Simple) diff --git a/src/test/scala/com/atomist/rug/test/gherkin/project/ProjectTestTargets.scala b/src/test/scala/com/atomist/rug/test/gherkin/project/ProjectTestTargets.scala index e786cb4a4..d40243777 100644 --- a/src/test/scala/com/atomist/rug/test/gherkin/project/ProjectTestTargets.scala +++ b/src/test/scala/com/atomist/rug/test/gherkin/project/ProjectTestTargets.scala @@ -35,6 +35,7 @@ object ProjectTestTargets { |Then("changes were made", p => true); // Override this one for this test |Then("one edit was made", p => true); |Then("the rage is maintained", p => p.fileExists("Gough")); + |Then("the rage has a name", p => p.name != null && p.name() != "" && p.name().length > 0); |""".stripMargin val EditorWithoutParametersTs = @@ -58,6 +59,9 @@ object ProjectTestTargets { |Then("the rage is maintained", p => { | return p.fileExists("Paul"); |}); + |Then("the rage has a name", p => { + | return p.name != null && p.name() != "" && p.name().length > 0; + |}); |""".stripMargin val EditorWithParametersTs = @@ -81,6 +85,9 @@ object ProjectTestTargets { |Then("the rage is maintained", p => { | return p.fileExists("Paul"); |}); + |Then("the rage has a name", p => { + | return p.name != null && p.name() != "" && p.name().length > 0; + |}); |""".stripMargin