trackler 1.0.4.0 → 1.0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/common/CONTRIBUTING.md +17 -2
- data/common/exercises/anagram/canonical-data.json +0 -14
- data/common/exercises/pig-latin/canonical-data.json +6 -1
- data/common/exercises/raindrops/description.md +4 -4
- data/common/exercises/raindrops/metadata.yml +1 -1
- data/common/exercises/roman-numerals/metadata.yml +1 -1
- data/lib/trackler/version.rb +1 -1
- data/tracks/c/config.json +12 -1
- data/tracks/c/exercises/roman-numerals/makefile +16 -0
- data/tracks/c/exercises/roman-numerals/src/example.c +43 -0
- data/tracks/c/exercises/roman-numerals/src/example.h +6 -0
- data/tracks/c/exercises/roman-numerals/test/test_roman_numerals.c +126 -0
- data/tracks/c/exercises/roman-numerals/test/vendor/unity.c +1300 -0
- data/tracks/c/exercises/roman-numerals/test/vendor/unity.h +274 -0
- data/tracks/c/exercises/roman-numerals/test/vendor/unity_internals.h +701 -0
- data/tracks/clojure/exercises/flatten-array/project.clj +4 -0
- data/tracks/csharp/exercises/protein-translation/ProteinTranslationTest.cs +1 -1
- data/tracks/elixir/exercises/bowling/bowling_test.exs +157 -62
- data/tracks/elixir/exercises/bowling/example.exs +33 -4
- data/tracks/erlang/config.json +176 -36
- data/tracks/go/.travis.yml +7 -1
- data/tracks/go/bin/test-without-stubs +29 -0
- data/tracks/go/exercises/robot-simulator/defs.go +1 -1
- data/tracks/go/exercises/variable-length-quantity/variable_length_quantity_test.go +31 -25
- data/tracks/haskell/.travis.yml +9 -5
- data/tracks/haskell/config.json +127 -121
- data/tracks/haskell/exercises/leap/src/LeapYear.hs +1 -1
- data/tracks/haskell/exercises/space-age/HINTS.md +14 -2
- data/tracks/haskell/exercises/space-age/{src/Example.hs → examples/success-double/SpaceAge.hs} +0 -0
- data/tracks/haskell/exercises/space-age/examples/success-double/package.yaml +19 -0
- data/tracks/haskell/exercises/space-age/examples/success-rational/SpaceAge.hs +24 -0
- data/tracks/haskell/exercises/space-age/examples/success-rational/package.yaml +19 -0
- data/tracks/haskell/exercises/space-age/src/SpaceAge.hs +4 -1
- data/tracks/haskell/exercises/space-age/test/Tests.hs +12 -5
- data/tracks/haskell/exercises/word-count/HINTS.md +21 -0
- data/tracks/haskell/exercises/word-count/examples/success-newtype/WordCount.hs +31 -0
- data/tracks/haskell/exercises/word-count/examples/success-newtype/package.yaml +21 -0
- data/tracks/haskell/exercises/word-count/examples/success-simple/WordCount.hs +13 -0
- data/tracks/haskell/exercises/word-count/examples/success-simple/package.yaml +20 -0
- data/tracks/haskell/exercises/word-count/package.yaml +0 -2
- data/tracks/haskell/exercises/word-count/src/WordCount.hs +2 -1
- data/tracks/haskell/exercises/word-count/test/Tests.hs +15 -6
- data/tracks/haskell/exercises/zebra-puzzle/package.yaml +19 -0
- data/tracks/haskell/exercises/zebra-puzzle/src/Example.hs +113 -0
- data/tracks/haskell/exercises/zebra-puzzle/src/ZebraPuzzle.hs +12 -0
- data/tracks/haskell/exercises/zebra-puzzle/stack.yaml +1 -0
- data/tracks/haskell/exercises/zebra-puzzle/test/Tests.hs +13 -0
- data/tracks/javascript/exercises/beer-song/beer-song.spec.js +5 -0
- data/tracks/lisp/config.json +147 -0
- data/tracks/ocaml/config.json +12 -0
- data/tracks/ocaml/exercises/atbash-cipher/.merlin +5 -0
- data/tracks/ocaml/exercises/atbash-cipher/HINTS.md +17 -0
- data/tracks/ocaml/exercises/atbash-cipher/Makefile +11 -0
- data/tracks/ocaml/exercises/atbash-cipher/atbash_cipher.mli +5 -0
- data/tracks/ocaml/exercises/atbash-cipher/example.ml +47 -0
- data/tracks/ocaml/exercises/atbash-cipher/test.ml +37 -0
- data/tracks/ocaml/exercises/meetup/.merlin +5 -0
- data/tracks/ocaml/exercises/meetup/Makefile +11 -0
- data/tracks/ocaml/exercises/meetup/example.ml +63 -0
- data/tracks/ocaml/exercises/meetup/meetup.mli +7 -0
- data/tracks/ocaml/exercises/meetup/test.ml +786 -0
- data/tracks/php/exercises/bowling/bowling_test.php +233 -10
- data/tracks/php/exercises/bowling/example.php +49 -6
- data/tracks/python/.travis.yml +5 -0
- data/tracks/python/config.json +33 -1
- data/tracks/python/exercises/flatten-array/example.py +18 -0
- data/tracks/python/exercises/flatten-array/flatten_array_test.py +40 -0
- data/tracks/python/exercises/robot-name/robot_name_test.py +8 -2
- data/tracks/r/config.json +32 -8
- data/tracks/ruby/bin/enable-executable +9 -5
- data/tracks/ruby/bin/executable-tests-check +7 -3
- data/tracks/ruby/bin/local-status-check +4 -4
- data/tracks/ruby/config.json +8 -1
- data/tracks/ruby/exercises/acronym/acronym_test.rb +0 -1
- data/tracks/ruby/exercises/anagram/.version +1 -0
- data/tracks/ruby/exercises/anagram/anagram_test.rb +101 -31
- data/tracks/ruby/exercises/anagram/example.rb +4 -0
- data/tracks/ruby/exercises/anagram/example.tt +19 -0
- data/tracks/ruby/exercises/gigasecond/.version +1 -1
- data/tracks/ruby/exercises/gigasecond/example.rb +1 -1
- data/tracks/ruby/exercises/gigasecond/gigasecond_test.rb +2 -2
- data/tracks/ruby/exercises/isogram/.version +1 -0
- data/tracks/ruby/exercises/isogram/example.rb +10 -0
- data/tracks/ruby/exercises/isogram/example.tt +20 -0
- data/tracks/ruby/exercises/isogram/isogram_test.rb +90 -0
- data/tracks/ruby/exercises/poker/example.rb +97 -39
- data/tracks/ruby/exercises/poker/poker_test.rb +67 -36
- data/tracks/ruby/exercises/sieve/.version +1 -0
- data/tracks/ruby/exercises/sieve/example.rb +4 -0
- data/tracks/ruby/exercises/sieve/example.tt +21 -0
- data/tracks/ruby/exercises/sieve/sieve_test.rb +36 -13
- data/tracks/ruby/exercises/word-count/example.tt +4 -3
- data/tracks/ruby/exercises/word-count/word_count_test.rb +38 -48
- data/tracks/ruby/lib/anagram_cases.rb +42 -0
- data/tracks/ruby/lib/isogram_cases.rb +24 -0
- data/tracks/ruby/lib/sieve_cases.rb +33 -0
- data/tracks/ruby/lib/word_count_cases.rb +19 -0
- data/tracks/scala/config.json +21 -0
- data/tracks/scala/docs/RESOURCES.md +1 -0
- data/tracks/scala/exercises/bracket-push/build.sbt +4 -0
- data/tracks/scala/exercises/bracket-push/example.scala +23 -0
- data/tracks/scala/exercises/bracket-push/src/main/scala/.keep +0 -0
- data/tracks/scala/exercises/bracket-push/src/test/scala/BracketsTest.scala +68 -0
- data/tracks/scala/exercises/change/src/test/scala/ChangeTest.scala +7 -0
- data/tracks/scala/exercises/sgf-parsing/build.sbt +7 -0
- data/tracks/scala/exercises/sgf-parsing/example.scala +66 -0
- data/tracks/scala/exercises/sgf-parsing/src/main/scala/.keep +0 -0
- data/tracks/scala/exercises/sgf-parsing/src/main/scala/Sgf.scala +17 -0
- data/tracks/scala/exercises/sgf-parsing/src/test/scala/SgfTest.scala +66 -0
- data/tracks/scala/exercises/zebra-puzzle/build.sbt +3 -0
- data/tracks/scala/exercises/zebra-puzzle/example.scala +152 -0
- data/tracks/scala/exercises/zebra-puzzle/src/main/scala/.keep +0 -0
- data/tracks/scala/exercises/zebra-puzzle/src/main/scala/ZebraPuzzle.scala +14 -0
- data/tracks/scala/exercises/zebra-puzzle/src/test/scala/ZebraPuzzleTest.scala +11 -0
- data/tracks/scala/testgen/src/main/scala/BracketPushTestGenerator.scala +44 -0
- metadata +63 -3
- data/tracks/haskell/exercises/word-count/src/Example.hs +0 -8
@@ -0,0 +1,18 @@
|
|
1
|
+
def is_iterable(thing):
|
2
|
+
try:
|
3
|
+
iter(thing)
|
4
|
+
except TypeError:
|
5
|
+
return False
|
6
|
+
else:
|
7
|
+
return True
|
8
|
+
|
9
|
+
|
10
|
+
def flatten(iterable):
|
11
|
+
"""Flatten a list of lists."""
|
12
|
+
flattened = []
|
13
|
+
for item in iterable:
|
14
|
+
if is_iterable(item) and not isinstance(item, (str, bytes)):
|
15
|
+
flattened += flatten(item)
|
16
|
+
elif item is not None:
|
17
|
+
flattened.append(item)
|
18
|
+
return flattened
|
@@ -0,0 +1,40 @@
|
|
1
|
+
import unittest
|
2
|
+
|
3
|
+
from flatten_array import flatten
|
4
|
+
|
5
|
+
|
6
|
+
class FlattenArrayTests(unittest.TestCase):
|
7
|
+
|
8
|
+
def test_no_nesting(self):
|
9
|
+
self.assertEqual(flatten([0, 1, 2]), [0, 1, 2])
|
10
|
+
|
11
|
+
def test_one_level_nesting(self):
|
12
|
+
self.assertEqual(flatten([0, [1], 2]), [0, 1, 2])
|
13
|
+
|
14
|
+
def test_two_level_nesting(self):
|
15
|
+
self.assertEqual(flatten([0, [1, [2, 3]], [4]]), [0, 1, 2, 3, 4])
|
16
|
+
|
17
|
+
def test_empty_nested_lists(self):
|
18
|
+
self.assertEqual(flatten([[()]]), [])
|
19
|
+
|
20
|
+
def test_with_none_values(self):
|
21
|
+
inputs = [0, 2, [[2, 3], 8, [[100]], None, [[None]]], -2]
|
22
|
+
expected = [0, 2, 2, 3, 8, 100, -2]
|
23
|
+
self.assertEqual(flatten(inputs), expected)
|
24
|
+
|
25
|
+
def test_six_level_nesting(self):
|
26
|
+
inputs = [1, [2, [[3]], [4, [[5]]], 6, 7], 8]
|
27
|
+
expected = [1, 2, 3, 4, 5, 6, 7, 8]
|
28
|
+
self.assertEqual(flatten(inputs), expected)
|
29
|
+
|
30
|
+
def test_all_values_are_none(self):
|
31
|
+
inputs = [None, [[[None]]], None, None, [[None, None], None], None]
|
32
|
+
expected = []
|
33
|
+
self.assertEqual(flatten(inputs), expected)
|
34
|
+
|
35
|
+
def test_strings(self):
|
36
|
+
self.assertEqual(flatten(['0', ['1', '2']]), ['0', '1', '2'])
|
37
|
+
|
38
|
+
|
39
|
+
if __name__ == '__main__':
|
40
|
+
unittest.main()
|
@@ -5,10 +5,15 @@ import random
|
|
5
5
|
|
6
6
|
|
7
7
|
class RobotTest(unittest.TestCase):
|
8
|
+
# assertRegex() alias to adress DeprecationWarning
|
9
|
+
# assertRegexpMatches got renamed in version 3.2
|
10
|
+
if not hasattr(unittest.TestCase, "assertRegex"):
|
11
|
+
assertRegex = unittest.TestCase.assertRegexpMatches
|
12
|
+
|
8
13
|
name_re = r'^[A-Z]{2}\d{3}$'
|
9
14
|
|
10
15
|
def test_has_name(self):
|
11
|
-
self.
|
16
|
+
self.assertRegex(Robot().name, self.name_re)
|
12
17
|
|
13
18
|
def test_name_sticks(self):
|
14
19
|
robot = Robot()
|
@@ -39,7 +44,8 @@ class RobotTest(unittest.TestCase):
|
|
39
44
|
robot.reset()
|
40
45
|
name2 = robot.name
|
41
46
|
self.assertNotEqual(name, name2)
|
42
|
-
self.
|
47
|
+
self.assertRegex(name2, self.name_re)
|
48
|
+
|
43
49
|
|
44
50
|
if __name__ == '__main__':
|
45
51
|
unittest.main()
|
data/tracks/r/config.json
CHANGED
@@ -4,14 +4,6 @@
|
|
4
4
|
"repository": "https://github.com/exercism/xr",
|
5
5
|
"checklist_issue": 5,
|
6
6
|
"active": false,
|
7
|
-
"problems": [
|
8
|
-
"anagram",
|
9
|
-
"bob",
|
10
|
-
"hello-world",
|
11
|
-
"luhn",
|
12
|
-
"space-age",
|
13
|
-
"word-count"
|
14
|
-
],
|
15
7
|
"deprecated": [
|
16
8
|
|
17
9
|
],
|
@@ -21,5 +13,37 @@
|
|
21
13
|
],
|
22
14
|
"foregone": [
|
23
15
|
|
16
|
+
],
|
17
|
+
"exercises": [
|
18
|
+
{
|
19
|
+
"difficulty": 1,
|
20
|
+
"slug": "anagram",
|
21
|
+
"topics": []
|
22
|
+
},
|
23
|
+
{
|
24
|
+
"difficulty": 1,
|
25
|
+
"slug": "bob",
|
26
|
+
"topics": []
|
27
|
+
},
|
28
|
+
{
|
29
|
+
"difficulty": 1,
|
30
|
+
"slug": "hello-world",
|
31
|
+
"topics": []
|
32
|
+
},
|
33
|
+
{
|
34
|
+
"difficulty": 1,
|
35
|
+
"slug": "luhn",
|
36
|
+
"topics": []
|
37
|
+
},
|
38
|
+
{
|
39
|
+
"difficulty": 1,
|
40
|
+
"slug": "space-age",
|
41
|
+
"topics": []
|
42
|
+
},
|
43
|
+
{
|
44
|
+
"difficulty": 1,
|
45
|
+
"slug": "word-count",
|
46
|
+
"topics": []
|
47
|
+
}
|
24
48
|
]
|
25
49
|
}
|
@@ -2,14 +2,18 @@
|
|
2
2
|
|
3
3
|
require 'fileutils'
|
4
4
|
|
5
|
-
puts 'Ensuring test files are executable
|
5
|
+
puts 'Ensuring test files are executable.'
|
6
6
|
|
7
|
-
|
8
|
-
|
7
|
+
# Assume that this file lives in #{base}/bin
|
8
|
+
base = File.join(__dir__,'..')
|
9
|
+
files = Dir.glob("#{base}/**/*test.rb") + Dir.glob("#{base}/bin/*")
|
10
|
+
|
11
|
+
files.each do |file|
|
12
|
+
if File.executable?(file)
|
9
13
|
print '.'
|
10
14
|
else
|
11
|
-
print "\nAdding exec bit to #{
|
12
|
-
FileUtils.chmod('u+x',
|
15
|
+
print "\nAdding exec bit to #{file}"
|
16
|
+
FileUtils.chmod('u+x', file)
|
13
17
|
end
|
14
18
|
end
|
15
19
|
puts
|
@@ -1,10 +1,14 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
require 'minitest/autorun'
|
3
3
|
|
4
|
-
|
5
|
-
|
4
|
+
# Assume that this file lives in #{base}/bin
|
5
|
+
base = File.join(__dir__,'..')
|
6
|
+
files = Dir.glob("#{base}/**/*test.rb") + Dir.glob("#{base}/bin/*")
|
7
|
+
|
8
|
+
files.each do |file|
|
9
|
+
describe file do
|
6
10
|
it 'should have the execution bit set' do
|
7
|
-
assert File.executable?(
|
11
|
+
assert File.executable?(file), "Execution bit not set for #{file}"
|
8
12
|
end
|
9
13
|
end
|
10
14
|
end
|
@@ -7,12 +7,12 @@ commands_to_run = [
|
|
7
7
|
'bundle exec rubocop -fs -D',
|
8
8
|
'bin/executable-tests-check',
|
9
9
|
]
|
10
|
-
|
10
|
+
success = []
|
11
11
|
commands_to_run.each do |c|
|
12
|
-
|
12
|
+
success << (system c)
|
13
13
|
end
|
14
|
-
unless
|
15
|
-
p
|
14
|
+
unless success.all?
|
15
|
+
p success
|
16
16
|
STDERR.puts <<-EOS
|
17
17
|
Push will be aborted!!! Fix the problem above and correct the commit.
|
18
18
|
EOS
|
data/tracks/ruby/config.json
CHANGED
@@ -84,7 +84,8 @@
|
|
84
84
|
"connect",
|
85
85
|
"list-ops",
|
86
86
|
"diamond",
|
87
|
-
"all-your-base"
|
87
|
+
"all-your-base",
|
88
|
+
"isogram"
|
88
89
|
],
|
89
90
|
"exercises": [
|
90
91
|
{
|
@@ -566,6 +567,12 @@
|
|
566
567
|
"difficulty": 1,
|
567
568
|
"topics": [
|
568
569
|
]
|
570
|
+
},
|
571
|
+
{
|
572
|
+
"slug": "isogram",
|
573
|
+
"difficulty": 1,
|
574
|
+
"topics": [
|
575
|
+
]
|
569
576
|
}
|
570
577
|
],
|
571
578
|
"deprecated": [
|
@@ -0,0 +1 @@
|
|
1
|
+
2
|
@@ -3,70 +3,140 @@ gem 'minitest', '>= 5.0.0'
|
|
3
3
|
require 'minitest/autorun'
|
4
4
|
require_relative 'anagram'
|
5
5
|
|
6
|
+
# Test data version:
|
7
|
+
# 6a886e0
|
6
8
|
class AnagramTest < Minitest::Test
|
7
9
|
def test_no_matches
|
10
|
+
# skip
|
8
11
|
detector = Anagram.new('diaper')
|
9
|
-
|
12
|
+
anagrams = detector.match(["hello", "world", "zombies", "pants"])
|
13
|
+
assert_equal [], anagrams
|
10
14
|
end
|
11
15
|
|
12
|
-
def
|
16
|
+
def test_detects_simple_anagram
|
13
17
|
skip
|
14
18
|
detector = Anagram.new('ant')
|
15
|
-
anagrams = detector.match(
|
16
|
-
assert_equal [
|
19
|
+
anagrams = detector.match(["tan", "stand", "at"])
|
20
|
+
assert_equal ["tan"], anagrams
|
17
21
|
end
|
18
22
|
|
19
|
-
def
|
23
|
+
def test_does_not_detect_false_positives
|
24
|
+
skip
|
25
|
+
detector = Anagram.new('galea')
|
26
|
+
anagrams = detector.match(["eagle"])
|
27
|
+
assert_equal [], anagrams
|
28
|
+
end
|
29
|
+
|
30
|
+
def test_detects_multiple_anagrams
|
20
31
|
skip
|
21
32
|
detector = Anagram.new('master')
|
22
|
-
anagrams = detector.match(
|
23
|
-
assert_equal
|
33
|
+
anagrams = detector.match(["stream", "pigeon", "maters"])
|
34
|
+
assert_equal ["maters", "stream"], anagrams.sort
|
24
35
|
end
|
25
36
|
|
26
|
-
def
|
37
|
+
def test_does_not_detect_anagram_subsets
|
27
38
|
skip
|
28
|
-
detector = Anagram.new('
|
29
|
-
|
39
|
+
detector = Anagram.new('good')
|
40
|
+
anagrams = detector.match(["dog", "goody"])
|
41
|
+
assert_equal [], anagrams
|
30
42
|
end
|
31
43
|
|
32
|
-
def
|
44
|
+
def test_detects_anagram
|
45
|
+
skip
|
46
|
+
detector = Anagram.new('listen')
|
47
|
+
anagrams = detector.match(["enlists", "google", "inlets", "banana"])
|
48
|
+
assert_equal ["inlets"], anagrams
|
49
|
+
end
|
50
|
+
|
51
|
+
def test_detects_multiple_anagrams
|
52
|
+
skip
|
53
|
+
detector = Anagram.new('allergy')
|
54
|
+
anagrams = detector.match(["gallery", "ballerina", "regally", "clergy", "largely", "leading"])
|
55
|
+
assert_equal ["gallery", "largely", "regally"], anagrams.sort
|
56
|
+
end
|
57
|
+
|
58
|
+
def test_does_not_detect_identical_words
|
33
59
|
skip
|
34
60
|
detector = Anagram.new('corn')
|
35
|
-
anagrams = detector.match
|
36
|
-
assert_equal [
|
61
|
+
anagrams = detector.match(["corn", "dark", "Corn", "rank", "CORN", "cron", "park"])
|
62
|
+
assert_equal ["cron"], anagrams
|
37
63
|
end
|
38
64
|
|
39
|
-
def
|
65
|
+
def test_does_not_detect_non_anagrams_with_identical_checksum
|
40
66
|
skip
|
41
67
|
detector = Anagram.new('mass')
|
42
|
-
|
68
|
+
anagrams = detector.match(["last"])
|
69
|
+
assert_equal [], anagrams
|
43
70
|
end
|
44
71
|
|
45
|
-
def
|
72
|
+
def test_detects_anagrams_case_insensitively
|
46
73
|
skip
|
47
|
-
detector = Anagram.new('
|
48
|
-
|
74
|
+
detector = Anagram.new('Orchestra')
|
75
|
+
anagrams = detector.match(["cashregister", "Carthorse", "radishes"])
|
76
|
+
assert_equal ["Carthorse"], anagrams
|
49
77
|
end
|
50
78
|
|
51
|
-
def
|
79
|
+
def test_detects_anagrams_using_case_insensitive_subject
|
52
80
|
skip
|
53
|
-
detector = Anagram.new('
|
54
|
-
anagrams = detector.match
|
55
|
-
assert_equal [
|
81
|
+
detector = Anagram.new('Orchestra')
|
82
|
+
anagrams = detector.match(["cashregister", "carthorse", "radishes"])
|
83
|
+
assert_equal ["carthorse"], anagrams
|
56
84
|
end
|
57
85
|
|
58
|
-
def
|
86
|
+
def test_detects_anagrams_using_case_insensitive_possible_matches
|
59
87
|
skip
|
60
|
-
detector = Anagram.new('
|
61
|
-
anagrams =
|
62
|
-
|
63
|
-
assert_equal %w(gallery largely regally), anagrams.sort
|
88
|
+
detector = Anagram.new('orchestra')
|
89
|
+
anagrams = detector.match(["cashregister", "Carthorse", "radishes"])
|
90
|
+
assert_equal ["Carthorse"], anagrams
|
64
91
|
end
|
65
92
|
|
66
|
-
def
|
93
|
+
def test_does_not_detect_a_word_as_its_own_anagram
|
67
94
|
skip
|
68
|
-
detector = Anagram.new('
|
69
|
-
anagrams = detector.match
|
70
|
-
assert_equal [
|
95
|
+
detector = Anagram.new('banana')
|
96
|
+
anagrams = detector.match(["Banana"])
|
97
|
+
assert_equal [], anagrams
|
98
|
+
end
|
99
|
+
|
100
|
+
def test_does_not_detect_a_anagram_if_the_original_word_is_repeated
|
101
|
+
skip
|
102
|
+
detector = Anagram.new('go')
|
103
|
+
anagrams = detector.match(["go Go GO"])
|
104
|
+
assert_equal [], anagrams
|
105
|
+
end
|
106
|
+
|
107
|
+
def test_anagrams_must_use_all_letters_exactly_once
|
108
|
+
skip
|
109
|
+
detector = Anagram.new('tapper')
|
110
|
+
anagrams = detector.match(["patter"])
|
111
|
+
assert_equal [], anagrams
|
112
|
+
end
|
113
|
+
|
114
|
+
def test_capital_word_is_not_own_anagram
|
115
|
+
skip
|
116
|
+
detector = Anagram.new('BANANA')
|
117
|
+
anagrams = detector.match(["Banana"])
|
118
|
+
assert_equal [], anagrams
|
119
|
+
end
|
120
|
+
|
121
|
+
# Problems in exercism evolve over time, as we find better ways to ask
|
122
|
+
# questions.
|
123
|
+
# The version number refers to the version of the problem you solved,
|
124
|
+
# not your solution.
|
125
|
+
#
|
126
|
+
# Define a constant named VERSION inside of the top level BookKeeping
|
127
|
+
# module, which may be placed near the end of your file.
|
128
|
+
#
|
129
|
+
# In your file, it will look like this:
|
130
|
+
#
|
131
|
+
# module BookKeeping
|
132
|
+
# VERSION = 1 # Where the version number matches the one in the test.
|
133
|
+
# end
|
134
|
+
#
|
135
|
+
# If you are curious, read more about constants on RubyDoc:
|
136
|
+
# http://ruby-doc.org/docs/ruby-doc-bundle/UsersGuide/rg/constants.html
|
137
|
+
|
138
|
+
def test_bookkeeping
|
139
|
+
skip
|
140
|
+
assert_equal 2, BookKeeping::VERSION
|
71
141
|
end
|
72
142
|
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
gem 'minitest', '>= 5.0.0'
|
3
|
+
require 'minitest/autorun'
|
4
|
+
require_relative 'anagram'
|
5
|
+
|
6
|
+
# Test data version:
|
7
|
+
# <%= sha1 %>
|
8
|
+
class AnagramTest < Minitest::Test<% test_cases.each do |test_case| %>
|
9
|
+
def <%= test_case.test_name %>
|
10
|
+
<%= test_case.skipped %>
|
11
|
+
<%= test_case.work_load %>
|
12
|
+
end
|
13
|
+
<% end %>
|
14
|
+
<%= IO.read(XRUBY_LIB + '/bookkeeping.md') %>
|
15
|
+
def test_bookkeeping
|
16
|
+
skip
|
17
|
+
assert_equal <%= version.next %>, BookKeeping::VERSION
|
18
|
+
end
|
19
|
+
end
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
5
|