private List<String> stripStorySuffixFrom(List<String> pathElements) { if ((!pathElements.isEmpty()) && isSupportedFileStoryExtension(last(pathElements))) { return dropLastElement(pathElements); } else { return pathElements; } }
private List<String> stripStorySuffixFrom(List<String> pathElements) { if ((!pathElements.isEmpty()) && isSupportedFileStoryExtension(last(pathElements))) { return dropLastElement(pathElements); } else { return pathElements; } }
private List<String> stripStorySuffixFrom(List<String> pathElements) { if ((!pathElements.isEmpty()) && isSupportedFileStoryExtension(last(pathElements))) { return dropLastElement(pathElements); } else { return pathElements; } }
private Optional<TestTag> storyTagFrom(List<String> storyPathElements) { if ((!storyPathElements.isEmpty()) && isSupportedFileStoryExtension(last(storyPathElements))) { String storyName = Lists.reverse(storyPathElements).get(1); String storyParent = parentElement(storyPathElements); String qualifiedName = storyParent == null ? humanize(storyName) : humanize(storyParent).trim() + "/" + humanize(storyName); TestTag storyTag = TestTag.withName(qualifiedName).andType("story"); return Optional.of(storyTag); } else { return Optional.absent(); } }
private Optional<TestTag> storyTagFrom(List<String> storyPathElements) { if ((!storyPathElements.isEmpty()) && isSupportedFileStoryExtension(last(storyPathElements))) { String storyName = Lists.reverse(storyPathElements).get(1); String storyParent = parentElement(storyPathElements); String qualifiedName = storyParent == null ? humanize(storyName) : humanize(storyParent).trim() + "/" + humanize(storyName); TestTag storyTag = TestTag.withName(qualifiedName).andType("story"); return Optional.of(storyTag); } else { return Optional.absent(); } }
private java.util.Optional<TestTag> storyOrFeatureDescribedIn(List<String> storyPathElements) { if ((!storyPathElements.isEmpty()) && isSupportedFileStoryExtension(last(storyPathElements))) { String storyName = NewList.reverse(storyPathElements).get(1); // TODO: Get the story or feature name from the file only as a last resort String storyParent = parentElement(storyPathElements); String qualifiedName = storyParent == null ? humanize(storyName) : humanize(storyParent).trim() + "/" + humanize(storyName); TestTag storyTag = TestTag.withName(qualifiedName).andType((last(storyPathElements))); return java.util.Optional.of(storyTag); } else { return java.util.Optional.empty(); } }