This repository has been archived by the owner on Dec 8, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Slight improvement to Canonicalizer test coverage
- Loading branch information
1 parent
a569cf8
commit 4dfd68d
Showing
2 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# 18F Hub - Docs & connections between team members, projects, and skill sets | ||
# | ||
# Written in 2015 by Mike Bland (michael.bland@gsa.gov) | ||
# on behalf of the 18F team, part of the US General Services Administration: | ||
# https://18f.gsa.gov/ | ||
# | ||
# To the extent possible under law, the author(s) have dedicated all copyright | ||
# and related and neighboring rights to this software to the public domain | ||
# worldwide. This software is distributed without any warranty. | ||
# | ||
# You should have received a copy of the CC0 Public Domain Dedication along | ||
# with this software. If not, see | ||
# <https://creativecommons.org/publicdomain/zero/1.0/>. | ||
# | ||
# @author Mike Bland (michael.bland@gsa.gov) | ||
|
||
require_relative "test_helper" | ||
require_relative "../_plugins/canonicalizer" | ||
|
||
require "minitest/autorun" | ||
|
||
module Hub | ||
class CanonicalizeTest < ::Minitest::Test | ||
def test_no_changes_needed | ||
result = Canonicalizer.canonicalize "service" | ||
assert_equal(result, "service") | ||
end | ||
|
||
def test_space_is_replaced | ||
result = Canonicalizer.canonicalize "public service" | ||
assert_equal(result, "public-service") | ||
end | ||
|
||
def test_multiple_spaces_are_replaced_once | ||
result = Canonicalizer.canonicalize "public service" | ||
assert_equal(result, "public-service") | ||
end | ||
end | ||
end |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# 18F Hub - Docs & connections between team members, projects, and skill sets | ||
# | ||
# Written in 2016 by Catherine Devlin (catherine.devlin@gsa.gov) | ||
# on behalf of the 18F team, part of the US General Services Administration: | ||
# https://18f.gsa.gov/ | ||
# | ||
# To the extent possible under law, the author(s) have dedicated all copyright | ||
# and related and neighboring rights to this software to the public domain | ||
# worldwide. This software is distributed without any warranty. | ||
# | ||
# You should have received a copy of the CC0 Public Domain Dedication along | ||
# with this software. If not, see | ||
# <https://creativecommons.org/publicdomain/zero/1.0/>. | ||
# | ||
# @author Catherine Devlin (catherine.devlin@gsa.gov) | ||
|
||
require_relative "test_helper" | ||
require_relative "../_plugins/canonicalizer" | ||
|
||
require "minitest/autorun" | ||
|
||
module Hub | ||
class HyphenateDateTest < ::Minitest::Test | ||
def test_string_hyphenated | ||
result = Canonicalizer.hyphenate_yyyymmdd "20170202" | ||
assert_equal(result, "2017-02-02") | ||
end | ||
end | ||
end |