Skip to content

Commit 7f55394

Browse files
authored
Merge pull request #500 from Insti/update_isogram_generator
[isogram] Update generator
2 parents f50fa49 + 722d0dd commit 7f55394

File tree

4 files changed

+19
-37
lines changed

4 files changed

+19
-37
lines changed

exercises/isogram/.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1
1+
2

exercises/isogram/example.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module BookKeeping
2-
VERSION = 1
2+
VERSION = 2
33
end
44

55
class Isogram

exercises/isogram/isogram_test.rb

Lines changed: 16 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,68 +4,55 @@
44
require 'minitest/autorun'
55
require_relative 'isogram'
66

7-
# Common test data version: c1cb73f
7+
# Common test data version: c59c2c4
88
class IsogramTest < Minitest::Test
9-
def test_duplicates
9+
def test_empty_string
1010
# skip
11-
string = 'duplicates'
11+
string = ''
1212
assert Isogram.is_isogram?(string)
1313
end
1414

15-
def test_eleven
15+
def test_isogram_with_only_lower_case_characters
16+
skip
17+
string = 'isogram'
18+
assert Isogram.is_isogram?(string)
19+
end
20+
21+
def test_word_with_one_duplicated_character
1622
skip
1723
string = 'eleven'
1824
refute Isogram.is_isogram?(string)
1925
end
2026

21-
def test_subdermatoglyphic
27+
def test_longest_reported_english_isogram
2228
skip
2329
string = 'subdermatoglyphic'
2430
assert Isogram.is_isogram?(string)
2531
end
2632

27-
def test_alphabet
33+
def test_word_with_duplicated_character_in_mixed_case
2834
skip
2935
string = 'Alphabet'
3036
refute Isogram.is_isogram?(string)
3137
end
3238

33-
def test_thumbscrew_japingly
39+
def test_hypothetical_isogrammic_word_with_hyphen
3440
skip
3541
string = 'thumbscrew-japingly'
3642
assert Isogram.is_isogram?(string)
3743
end
3844

39-
def test_hjelmqvist_gryb_zock_pfund_wax
45+
def test_isogram_with_duplicated_non_letter_character
4046
skip
4147
string = 'Hjelmqvist-Gryb-Zock-Pfund-Wax'
4248
assert Isogram.is_isogram?(string)
4349
end
4450

45-
def test_heizölrückstoßabdämpfung
46-
skip
47-
string = 'Heizölrückstoßabdämpfung'
48-
assert Isogram.is_isogram?(string)
49-
end
50-
51-
def test_the_quick_brown_fox
52-
skip
53-
string = 'the quick brown fox'
54-
refute Isogram.is_isogram?(string)
55-
end
56-
57-
def test_emily_jung_schwartzkopf
51+
def test_made_up_name_that_is_an_isogram
5852
skip
5953
string = 'Emily Jung Schwartzkopf'
6054
assert Isogram.is_isogram?(string)
6155
end
62-
63-
def test_éléphant
64-
skip
65-
string = 'éléphant'
66-
refute Isogram.is_isogram?(string)
67-
end
68-
6956
# Problems in exercism evolve over time, as we find better ways to ask
7057
# questions.
7158
# The version number refers to the version of the problem you solved,
@@ -82,9 +69,8 @@ def test_éléphant
8269
#
8370
# If you are curious, read more about constants on RubyDoc:
8471
# http://ruby-doc.org/docs/ruby-doc-bundle/UsersGuide/rg/constants.html
85-
8672
def test_bookkeeping
8773
skip
88-
assert_equal 1, BookKeeping::VERSION
74+
assert_equal 2, BookKeeping::VERSION
8975
end
9076
end

lib/isogram_cases.rb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
class IsogramCase < OpenStruct
22

33
def name
4-
format('test_%s', description)
5-
end
6-
7-
def description
8-
input.downcase.gsub(/[ -]/,'_')
4+
format('test_%s', description.downcase.gsub(/[ -]/,'_'))
95
end
106

117
def assertion

0 commit comments

Comments
 (0)