From 21e8de9d2978e80dee971e64bfbbaa7bfa96f717 Mon Sep 17 00:00:00 2001 From: John Ferguson Smart Date: Mon, 6 May 2013 17:28:46 +1000 Subject: [PATCH] updated versions --- pom.xml | 8 ++++---- .../net/thucydides/jbehave/ThucydidesReporter.java | 6 +++++- .../jbehave/WhenRunningJBehaveStories.java | 14 ++++++++++++++ src/test/resources/stories/aBehaviorWithTags.story | 2 +- 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index c4cd397..48d359d 100644 --- a/pom.xml +++ b/pom.xml @@ -4,11 +4,11 @@ thucydides net.thucydides - 0.9.120 + 0.9.125 net.thucydides thucydides-jbehave-plugin - 0.9.123-SNAPSHOT + 0.9.125-SNAPSHOT thucydides-jbehave-plugin UTF-8 @@ -36,7 +36,7 @@ net.thucydides thucydides-core - 0.9.120 + 0.9.125 org.jbehave @@ -68,7 +68,7 @@ net.thucydides thucydides-sample-alternative-resources - 0.9.103 + 0.9.125 test diff --git a/src/main/java/net/thucydides/jbehave/ThucydidesReporter.java b/src/main/java/net/thucydides/jbehave/ThucydidesReporter.java index c2d0e61..abc84fb 100644 --- a/src/main/java/net/thucydides/jbehave/ThucydidesReporter.java +++ b/src/main/java/net/thucydides/jbehave/ThucydidesReporter.java @@ -269,7 +269,11 @@ private Converter toTags() { return new Converter() { public TestTag convert(String tag) { List tagParts = Lists.newArrayList(Splitter.on(":").trimResults().split(tag)); - return TestTag.withName(tagParts.get(1)).andType(tagParts.get(0)); + if (tagParts.size() == 2) { + return TestTag.withName(tagParts.get(1)).andType(tagParts.get(0)); + } else { + return TestTag.withName("true").andType(tagParts.get(0)); + } } }; } diff --git a/src/test/java/net/thucydides/jbehave/WhenRunningJBehaveStories.java b/src/test/java/net/thucydides/jbehave/WhenRunningJBehaveStories.java index 01d6b13..0fada12 100644 --- a/src/test/java/net/thucydides/jbehave/WhenRunningJBehaveStories.java +++ b/src/test/java/net/thucydides/jbehave/WhenRunningJBehaveStories.java @@ -453,6 +453,20 @@ public void a_test_should_have_tags_defined_by_the_tag_meta_field() throws Throw assertThat(outcomes.get(0), havingTag(TestTag.withName("a domain").andType("domain"))); } + @Test + public void a_test_should_accept_boolean_tags() throws Throwable { + + // Given + ThucydidesJUnitStories story = newStory("aBehaviorWithTags.story"); + + // When + run(story); + + // Then + List outcomes = loadTestOutcomes(); + assertThat(outcomes.get(0), havingTag(TestTag.withName("true").andType("security"))); + } + @Test public void a_test_should_have_storywide_tags_defined_by_the_tag_meta_field() throws Throwable { diff --git a/src/test/resources/stories/aBehaviorWithTags.story b/src/test/resources/stories/aBehaviorWithTags.story index 974b622..b198e17 100644 --- a/src/test/resources/stories/aBehaviorWithTags.story +++ b/src/test/resources/stories/aBehaviorWithTags.story @@ -3,7 +3,7 @@ Meta: Scenario: A scenario that works Meta: -@tags domain:a domain, iteration: iteration 1 +@tags domain:a domain, iteration: iteration 1, security Given I have an implemented JBehave scenario And the scenario works