From dbebdc94ca9555161fb48449b11fe6cea9266712 Mon Sep 17 00:00:00 2001 From: Glenn Jackman Date: Sat, 2 May 2026 13:34:59 -0400 Subject: [PATCH] Add colons to spec describe descriptions This is a "no important files changed" change. --- exercises/practice/acronym/acronym_spec.moon | 2 +- .../affine-cipher/affine_cipher_spec.moon | 6 +- .../all-your-base/all_your_base_spec.moon | 2 +- .../practice/allergies/allergies_spec.moon | 20 ++-- .../alphametics/alphametics_spec.moon | 60 +++++------ exercises/practice/anagram/anagram_spec.moon | 2 +- .../armstrong_numbers_spec.moon | 2 +- .../atbash-cipher/atbash_cipher_spec.moon | 6 +- .../baffling_birthdays_spec.moon | 8 +- .../bank-account/.meta/spec_generator.moon | 1 + .../binary_search_tree_spec.moon | 66 ++++++------ .../binary-search/binary_search_spec.moon | 2 +- exercises/practice/bob/bob_spec.moon | 2 +- .../practice/book-store/book_store_spec.moon | 2 +- exercises/practice/camicia/camicia_spec.moon | 2 +- exercises/practice/change/change_spec.moon | 2 +- .../circular-buffer/circular_buffer_spec.moon | 2 +- exercises/practice/clock/clock_spec.moon | 10 +- .../collatz_conjecture_spec.moon | 2 +- .../complex-numbers/complex_numbers_spec.moon | 24 ++--- exercises/practice/connect/connect_spec.moon | 2 +- .../crypto-square/crypto_square_spec.moon | 2 +- .../practice/custom-set/custom_set_spec.moon | 20 ++-- exercises/practice/darts/darts_spec.moon | 2 +- exercises/practice/diamond/diamond_spec.moon | 2 +- .../difference_of_squares_spec.moon | 8 +- .../dnd-character/dnd_character_spec.moon | 4 +- .../practice/dominoes/dominoes_spec.moon | 2 +- .../eliuds-eggs/eliuds_eggs_spec.moon | 2 +- exercises/practice/etl/etl_spec.moon | 2 +- .../flatten-array/flatten_array_spec.moon | 2 +- .../flower-field/flower_field_spec.moon | 2 +- .../practice/food-chain/food_chain_spec.moon | 2 +- exercises/practice/forth/forth_spec.moon | 26 ++--- .../game-of-life/game_of_life_spec.moon | 2 +- .../practice/gigasecond/gigasecond_spec.moon | 2 +- .../grade-school/grade_school_spec.moon | 2 +- exercises/practice/grains/grains_spec.moon | 4 +- exercises/practice/hamming/hamming_spec.moon | 2 +- .../hello-world/.meta/spec_generator.moon | 1 + .../high-scores/high_scores_spec.moon | 4 +- exercises/practice/house/house_spec.moon | 2 +- .../isbn-verifier/isbn_verifier_spec.moon | 2 +- exercises/practice/isogram/isogram_spec.moon | 2 +- .../.meta/.spec_generator.moon | 24 ----- .../.meta/spec_generator.moon | 2 - .../practice/knapsack/knapsack_spec.moon | 78 +++++++------- .../largest_series_product_spec.moon | 2 +- exercises/practice/leap/leap_spec.moon | 2 +- exercises/practice/line-up/line_up_spec.moon | 2 +- .../linked-list/linked_list_spec.moon | 2 +- exercises/practice/luhn/luhn_spec.moon | 2 +- .../practice/markdown/markdown_spec.moon | 2 +- .../matching_brackets_spec.moon | 2 +- exercises/practice/matrix/matrix_spec.moon | 2 +- exercises/practice/meetup/meetup_spec.moon | 2 +- .../practice/micro-blog/micro_blog_spec.moon | 2 +- .../practice/nth-prime/nth_prime_spec.moon | 2 +- .../nucleotide_count_spec.moon | 2 +- .../palindrome_products_spec.moon | 2 +- exercises/practice/pangram/pangram_spec.moon | 2 +- .../pascals_triangle_spec.moon | 2 +- .../perfect-numbers/perfect_numbers_spec.moon | 10 +- .../phone-number/phone_number_spec.moon | 2 +- .../practice/pig-latin/pig_latin_spec.moon | 14 +-- .../prime-factors/prime_factors_spec.moon | 2 +- exercises/practice/prism/prism_spec.moon | 2 +- .../protein_translation_spec.moon | 2 +- exercises/practice/proverb/proverb_spec.moon | 2 +- .../pythagorean_triplet_spec.moon | 2 +- .../queen-attack/queen_attack_spec.moon | 6 +- .../rail_fence_cipher_spec.moon | 6 +- .../practice/raindrops/raindrops_spec.moon | 2 +- .../rational_numbers_spec.moon | 20 ++-- .../practice/react/.meta/spec_generator.moon | 1 + .../practice/rectangles/rectangles_spec.moon | 2 +- .../resistor_color_duo_spec.moon | 2 +- .../resistor_color_trio_spec.moon | 2 +- .../resistor-color/resistor_color_spec.moon | 4 +- .../practice/rest-api/rest_api_spec.moon | 100 +++++++++--------- .../reverse-string/reverse_string_spec.moon | 2 +- .../rna_transcription_spec.moon | 2 +- .../robot-name/.meta/spec_generator.moon | 1 + .../robot-simulator/robot_simulator_spec.moon | 12 +-- .../roman-numerals/roman_numerals_spec.moon | 2 +- .../rotational_cipher_spec.moon | 2 +- .../run_length_encoding_spec.moon | 8 +- .../saddle-points/saddle_points_spec.moon | 2 +- .../satellite/.meta/spec_generator.moon | 1 + exercises/practice/say/say_spec.moon | 2 +- .../scrabble-score/scrabble_score_spec.moon | 2 +- .../secret_handshake_spec.moon | 2 +- exercises/practice/series/series_spec.moon | 2 +- .../sgf-parsing/sgf_parsing_spec.moon | 10 +- exercises/practice/sieve/sieve_spec.moon | 2 +- .../simple-cipher/simple_cipher_spec.moon | 6 +- .../simple_linked_list_spec.moon | 14 +-- .../practice/space-age/space_age_spec.moon | 2 +- .../spiral-matrix/spiral_matrix_spec.moon | 2 +- .../split_second_stopwatch_spec.moon | 2 +- .../square-root/square_root_spec.moon | 2 +- .../state_of_tic_tac_toe_spec.moon | 10 +- exercises/practice/strain/strain_spec.moon | 2 +- .../sum_of_multiples_spec.moon | 2 +- .../swift_scheduling_spec.moon | 2 +- .../practice/tournament/tournament_spec.moon | 2 +- .../practice/transpose/transpose_spec.moon | 2 +- .../practice/triangle/triangle_spec.moon | 8 +- .../twelve-days/twelve_days_spec.moon | 6 +- .../practice/two-bucket/two_bucket_spec.moon | 2 +- .../two-fer/.meta/spec_generator.moon | 1 + .../variable_length_quantity_spec.moon | 6 +- .../practice/word-count/word_count_spec.moon | 44 ++++---- exercises/practice/wordy/wordy_spec.moon | 2 +- exercises/practice/yacht/yacht_spec.moon | 2 +- .../zebra-puzzle/zebra_puzzle_spec.moon | 2 +- 116 files changed, 396 insertions(+), 416 deletions(-) create mode 100644 exercises/practice/bank-account/.meta/spec_generator.moon create mode 100644 exercises/practice/hello-world/.meta/spec_generator.moon delete mode 100644 exercises/practice/kindergarten-garden/.meta/.spec_generator.moon create mode 100644 exercises/practice/react/.meta/spec_generator.moon create mode 100644 exercises/practice/robot-name/.meta/spec_generator.moon create mode 100644 exercises/practice/satellite/.meta/spec_generator.moon create mode 100644 exercises/practice/two-fer/.meta/spec_generator.moon diff --git a/exercises/practice/acronym/acronym_spec.moon b/exercises/practice/acronym/acronym_spec.moon index 5ff26ab..51e530c 100644 --- a/exercises/practice/acronym/acronym_spec.moon +++ b/exercises/practice/acronym/acronym_spec.moon @@ -1,6 +1,6 @@ import abbreviate from require 'acronym' -describe 'acronym', -> +describe 'acronym:', -> it 'basic', -> result = abbreviate 'Portable Network Graphics' assert.are.equal 'PNG', result diff --git a/exercises/practice/affine-cipher/affine_cipher_spec.moon b/exercises/practice/affine-cipher/affine_cipher_spec.moon index 4cf188a..7080114 100644 --- a/exercises/practice/affine-cipher/affine_cipher_spec.moon +++ b/exercises/practice/affine-cipher/affine_cipher_spec.moon @@ -1,7 +1,7 @@ import encode, decode from require 'affine_cipher' -describe 'affine-cipher', -> - describe 'encode', -> +describe 'affine-cipher:', -> + describe 'encode:', -> it 'encode yes', -> result = encode 'yes', {a: 5, b: 7} expected = 'xbt' @@ -46,7 +46,7 @@ describe 'affine-cipher', -> f = -> encode 'This is a test.', {a: 6, b: 17} assert.has.error f, 'a and m must be coprime.' - describe 'decode', -> + describe 'decode:', -> pending 'decode exercism', -> result = decode 'tytgn fjr', {a: 3, b: 7} expected = 'exercism' diff --git a/exercises/practice/all-your-base/all_your_base_spec.moon b/exercises/practice/all-your-base/all_your_base_spec.moon index adc3b96..958d3d7 100644 --- a/exercises/practice/all-your-base/all_your_base_spec.moon +++ b/exercises/practice/all-your-base/all_your_base_spec.moon @@ -1,6 +1,6 @@ import rebase from require 'all_your_base' -describe 'all-your-base', -> +describe 'all-your-base:', -> it 'single bit one to decimal', -> result = rebase in_base: 2, out_base: 10, digits: {1} expected = {1} diff --git a/exercises/practice/allergies/allergies_spec.moon b/exercises/practice/allergies/allergies_spec.moon index d5c5824..b089f01 100644 --- a/exercises/practice/allergies/allergies_spec.moon +++ b/exercises/practice/allergies/allergies_spec.moon @@ -1,7 +1,7 @@ Allergies = require 'allergies' -describe 'allergies', -> - describe 'testing for eggs allergy', -> +describe 'allergies:', -> + describe 'testing for eggs allergy:', -> it 'not allergic to anything', -> result = Allergies.allergic_to 'eggs', 0 assert.is_false result @@ -22,7 +22,7 @@ describe 'allergies', -> result = Allergies.allergic_to 'eggs', 255 assert.is_true result - describe 'testing for peanuts allergy', -> + describe 'testing for peanuts allergy:', -> pending 'not allergic to anything', -> result = Allergies.allergic_to 'peanuts', 0 assert.is_false result @@ -43,7 +43,7 @@ describe 'allergies', -> result = Allergies.allergic_to 'peanuts', 255 assert.is_true result - describe 'testing for shellfish allergy', -> + describe 'testing for shellfish allergy:', -> pending 'not allergic to anything', -> result = Allergies.allergic_to 'shellfish', 0 assert.is_false result @@ -64,7 +64,7 @@ describe 'allergies', -> result = Allergies.allergic_to 'shellfish', 255 assert.is_true result - describe 'testing for strawberries allergy', -> + describe 'testing for strawberries allergy:', -> pending 'not allergic to anything', -> result = Allergies.allergic_to 'strawberries', 0 assert.is_false result @@ -85,7 +85,7 @@ describe 'allergies', -> result = Allergies.allergic_to 'strawberries', 255 assert.is_true result - describe 'testing for tomatoes allergy', -> + describe 'testing for tomatoes allergy:', -> pending 'not allergic to anything', -> result = Allergies.allergic_to 'tomatoes', 0 assert.is_false result @@ -106,7 +106,7 @@ describe 'allergies', -> result = Allergies.allergic_to 'tomatoes', 255 assert.is_true result - describe 'testing for chocolate allergy', -> + describe 'testing for chocolate allergy:', -> pending 'not allergic to anything', -> result = Allergies.allergic_to 'chocolate', 0 assert.is_false result @@ -127,7 +127,7 @@ describe 'allergies', -> result = Allergies.allergic_to 'chocolate', 255 assert.is_true result - describe 'testing for pollen allergy', -> + describe 'testing for pollen allergy:', -> pending 'not allergic to anything', -> result = Allergies.allergic_to 'pollen', 0 assert.is_false result @@ -148,7 +148,7 @@ describe 'allergies', -> result = Allergies.allergic_to 'pollen', 255 assert.is_true result - describe 'testing for cats allergy', -> + describe 'testing for cats allergy:', -> pending 'not allergic to anything', -> result = Allergies.allergic_to 'cats', 0 assert.is_false result @@ -169,7 +169,7 @@ describe 'allergies', -> result = Allergies.allergic_to 'cats', 255 assert.is_true result - describe 'list when:', -> + describe 'list when::', -> pending 'no allergies', -> result = Allergies.list 0 expected = {} diff --git a/exercises/practice/alphametics/alphametics_spec.moon b/exercises/practice/alphametics/alphametics_spec.moon index 9bdf2ea..22ef061 100644 --- a/exercises/practice/alphametics/alphametics_spec.moon +++ b/exercises/practice/alphametics/alphametics_spec.moon @@ -1,6 +1,6 @@ import solve from require 'alphametics' -describe 'alphametics', -> +describe 'alphametics:', -> -- ---------------------------------------------------------- same_kv = (state, arguments) -> actual = arguments[1] @@ -23,8 +23,8 @@ describe 'alphametics', -> result = solve puzzle expected = { I: 1, - L: 0, B: 9, + L: 0, } assert.is.same_kv result, expected @@ -41,8 +41,8 @@ describe 'alphametics', -> result = solve puzzle expected = { A: 9, - C: 0, B: 1, + C: 0, } assert.is.same_kv result, expected @@ -62,11 +62,11 @@ describe 'alphametics', -> result = solve puzzle expected = { E: 2, - L: 1, + N: 7, + O: 4, A: 0, T: 9, - O: 4, - N: 7, + L: 1, } assert.is.same_kv result, expected @@ -75,12 +75,12 @@ describe 'alphametics', -> result = solve puzzle expected = { E: 4, - L: 1, - S: 9, - I: 0, - H: 5, G: 2, + H: 5, + I: 0, T: 7, + S: 9, + L: 1, } assert.is.same_kv result, expected @@ -89,13 +89,13 @@ describe 'alphametics', -> result = solve puzzle expected = { E: 5, - D: 7, - S: 9, - R: 8, - Y: 2, - M: 1, - O: 0, N: 6, + O: 0, + M: 1, + Y: 2, + R: 8, + S: 9, + D: 7, } assert.is.same_kv result, expected @@ -103,16 +103,16 @@ describe 'alphametics', -> puzzle = 'AND + A + STRONG + OFFENSE + AS + A + GOOD == DEFENSE' result = solve puzzle expected = { - A: 5, - O: 2, N: 0, + O: 2, E: 4, - D: 3, - S: 6, - R: 1, - T: 9, - G: 8, F: 7, + G: 8, + T: 9, + A: 5, + R: 1, + S: 6, + D: 3, } assert.is.same_kv result, expected @@ -120,15 +120,15 @@ describe 'alphametics', -> puzzle = 'THIS + A + FIRE + THEREFORE + FOR + ALL + HISTORIES + I + TELL + A + TALE + THAT + FALSIFIES + ITS + TITLE + TIS + A + LIE + THE + TALE + OF + THE + LAST + FIRE + HORSES + LATE + AFTER + THE + FIRST + FATHERS + FORESEE + THE + HORRORS + THE + LAST + FREE + TROLL + TERRIFIES + THE + HORSES + OF + FIRE + THE + TROLL + RESTS + AT + THE + HOLE + OF + LOSSES + IT + IS + THERE + THAT + SHE + STORES + ROLES + OF + LEATHERS + AFTER + SHE + SATISFIES + HER + HATE + OFF + THOSE + FEARS + A + TASTE + RISES + AS + SHE + HEARS + THE + LEAST + FAR + HORSE + THOSE + FAST + HORSES + THAT + FIRST + HEAR + THE + TROLL + FLEE + OFF + TO + THE + FOREST + THE + HORSES + THAT + ALERTS + RAISE + THE + STARES + OF + THE + OTHERS + AS + THE + TROLL + ASSAILS + AT + THE + TOTAL + SHIFT + HER + TEETH + TEAR + HOOF + OFF + TORSO + AS + THE + LAST + HORSE + FORFEITS + ITS + LIFE + THE + FIRST + FATHERS + HEAR + OF + THE + HORRORS + THEIR + FEARS + THAT + THE + FIRES + FOR + THEIR + FEASTS + ARREST + AS + THE + FIRST + FATHERS + RESETTLE + THE + LAST + OF + THE + FIRE + HORSES + THE + LAST + TROLL + HARASSES + THE + FOREST + HEART + FREE + AT + LAST + OF + THE + LAST + TROLL + ALL + OFFER + THEIR + FIRE + HEAT + TO + THE + ASSISTERS + FAR + OFF + THE + TROLL + FASTS + ITS + LIFE + SHORTER + AS + STARS + RISE + THE + HORSES + REST + SAFE + AFTER + ALL + SHARE + HOT + FISH + AS + THEIR + AFFILIATES + TAILOR + A + ROOFS + FOR + THEIR + SAFE == FORTRESSES' result = solve puzzle expected = { - L: 2, - A: 1, O: 6, - E: 0, - T: 9, - S: 4, - R: 3, I: 7, - H: 8, + L: 2, + E: 0, F: 5, + H: 8, + A: 1, + R: 3, + S: 4, + T: 9, } assert.is.same_kv result, expected diff --git a/exercises/practice/anagram/anagram_spec.moon b/exercises/practice/anagram/anagram_spec.moon index 708f5fb..d7c5794 100644 --- a/exercises/practice/anagram/anagram_spec.moon +++ b/exercises/practice/anagram/anagram_spec.moon @@ -1,6 +1,6 @@ find_anagrams = require 'anagram' -describe 'anagram', -> +describe 'anagram:', -> it 'no matches', -> result = find_anagrams 'diaper', {'hello', 'world', 'zombies', 'pants'} expected = {} diff --git a/exercises/practice/armstrong-numbers/armstrong_numbers_spec.moon b/exercises/practice/armstrong-numbers/armstrong_numbers_spec.moon index 0cb8988..bc8f5e3 100644 --- a/exercises/practice/armstrong-numbers/armstrong_numbers_spec.moon +++ b/exercises/practice/armstrong-numbers/armstrong_numbers_spec.moon @@ -1,6 +1,6 @@ ArmstrongNumbers = require 'armstrong_numbers' -describe 'armstrong-numbers', -> +describe 'armstrong-numbers:', -> it 'Zero is an Armstrong number', -> result = ArmstrongNumbers.is_armstrong 0 assert.is_true result diff --git a/exercises/practice/atbash-cipher/atbash_cipher_spec.moon b/exercises/practice/atbash-cipher/atbash_cipher_spec.moon index c4b15de..d6a8898 100644 --- a/exercises/practice/atbash-cipher/atbash_cipher_spec.moon +++ b/exercises/practice/atbash-cipher/atbash_cipher_spec.moon @@ -1,7 +1,7 @@ AtbashCipher = require 'atbash_cipher' -describe 'atbash-cipher', -> - describe 'encode', -> +describe 'atbash-cipher:', -> + describe 'encode:', -> it 'encode yes', -> result = AtbashCipher.encode 'yes' expected = 'bvh' @@ -42,7 +42,7 @@ describe 'atbash-cipher', -> expected = 'gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt' assert.are.equal expected, result - describe 'decode', -> + describe 'decode:', -> pending 'decode exercism', -> result = AtbashCipher.decode 'vcvix rhn' expected = 'exercism' diff --git a/exercises/practice/baffling-birthdays/baffling_birthdays_spec.moon b/exercises/practice/baffling-birthdays/baffling_birthdays_spec.moon index 8f6196c..5993114 100644 --- a/exercises/practice/baffling-birthdays/baffling_birthdays_spec.moon +++ b/exercises/practice/baffling-birthdays/baffling_birthdays_spec.moon @@ -1,6 +1,6 @@ BafflingBirthdays = require 'baffling_birthdays' -describe 'baffling-birthdays', -> +describe 'baffling-birthdays:', -> -- ---------------------------------------- -- https://lunarmodules.github.io/Penlight/libraries/pl.tablex.html tablex = require 'pl.tablex' @@ -20,7 +20,7 @@ describe 'baffling-birthdays', -> isLeapYear = (year) -> year % 4 == 0 and (year % 100 != 0 or year % 400 == 0) -- ---------------------------------------- - describe 'shared birthday', -> + describe 'shared birthday:', -> it 'one birthdate', -> birthdates = {'2000-01-01'} assert.is.false BafflingBirthdays.sharedBirthday birthdates @@ -57,7 +57,7 @@ describe 'baffling-birthdays', -> birthdates = {'1966-07-29', '1977-02-12', '2001-12-25', '1980-07-29', '2019-02-12'} assert.is.true BafflingBirthdays.sharedBirthday birthdates - describe 'random birthdates', -> + describe 'random birthdates:', -> pending 'generate requested number of birthdates', -> result = true for n = 1, 100 @@ -90,7 +90,7 @@ describe 'baffling-birthdays', -> notSeen = [day for day,count in pairs days when count == 0] assert.is.equal 0, #notSeen - describe 'estimated probability of at least one shared birthday', -> + describe 'estimated probability of at least one shared birthday:', -> pending 'for one person', -> result = BafflingBirthdays.estimatedProbabilityOfSharedBirthday 1 assert.is.approx_equal 0.0, result diff --git a/exercises/practice/bank-account/.meta/spec_generator.moon b/exercises/practice/bank-account/.meta/spec_generator.moon new file mode 100644 index 0000000..6efb5e1 --- /dev/null +++ b/exercises/practice/bank-account/.meta/spec_generator.moon @@ -0,0 +1 @@ +error 'bank-account does not use a generator. Please update spec by hand.' diff --git a/exercises/practice/binary-search-tree/binary_search_tree_spec.moon b/exercises/practice/binary-search-tree/binary_search_tree_spec.moon index 4eaf115..f3995c3 100644 --- a/exercises/practice/binary-search-tree/binary_search_tree_spec.moon +++ b/exercises/practice/binary-search-tree/binary_search_tree_spec.moon @@ -1,28 +1,28 @@ BinarySearchTree = require 'binary_search_tree' -describe 'binary-search-tree', -> +describe 'binary-search-tree:', -> it 'data is retained', -> tree = BinarySearchTree {'4'} result = tree\data! expected = { - left: nil - right: nil data: "4" + right: nil + left: nil } assert.are.same expected, result - describe 'insert data at proper node', -> + describe 'insert data at proper node:', -> pending 'smaller number at left node', -> tree = BinarySearchTree {'4', '2'} result = tree\data! expected = { + data: "4" + right: nil left: { - left: nil - right: nil data: "2" + right: nil + left: nil } - right: nil - data: "4" } assert.are.same expected, result @@ -30,13 +30,13 @@ describe 'binary-search-tree', -> tree = BinarySearchTree {'4', '4'} result = tree\data! expected = { + data: "4" + right: nil left: { - left: nil - right: nil data: "4" + right: nil + left: nil } - right: nil - data: "4" } assert.are.same expected, result @@ -44,13 +44,13 @@ describe 'binary-search-tree', -> tree = BinarySearchTree {'4', '5'} result = tree\data! expected = { - left: nil + data: "4" right: { - left: nil - right: nil data: "5" + right: nil + left: nil } - data: "4" + left: nil } assert.are.same expected, result @@ -58,37 +58,37 @@ describe 'binary-search-tree', -> tree = BinarySearchTree {'4', '2', '6', '1', '3', '5', '7'} result = tree\data! expected = { - left: { - left: { - left: nil - right: nil - data: "1" - } + data: "4" + right: { + data: "6" right: { - left: nil + data: "7" right: nil - data: "3" + left: nil } - data: "2" - } - right: { left: { - left: nil - right: nil data: "5" + right: nil + left: nil } + } + left: { + data: "2" right: { + data: "3" + right: nil left: nil + } + left: { + data: "1" right: nil - data: "7" + left: nil } - data: "6" } - data: "4" } assert.are.same expected, result - describe 'can sort data', -> + describe 'can sort data:', -> pending 'can sort single number', -> tree = BinarySearchTree {'2'} result = tree\sorted! diff --git a/exercises/practice/binary-search/binary_search_spec.moon b/exercises/practice/binary-search/binary_search_spec.moon index d20b6a4..7cc4779 100644 --- a/exercises/practice/binary-search/binary_search_spec.moon +++ b/exercises/practice/binary-search/binary_search_spec.moon @@ -1,6 +1,6 @@ BinarySearch = require 'binary_search' -describe 'binary-search', -> +describe 'binary-search:', -> -- Remember, Lua (and MoonScript) use 1-based indexing. it 'finds a value in an array with one element', -> diff --git a/exercises/practice/bob/bob_spec.moon b/exercises/practice/bob/bob_spec.moon index dc1317c..8f8b180 100644 --- a/exercises/practice/bob/bob_spec.moon +++ b/exercises/practice/bob/bob_spec.moon @@ -1,6 +1,6 @@ Bob = require 'bob' -describe 'bob', -> +describe 'bob:', -> it 'stating something', -> result = Bob.hey "Tom-ay-to, tom-aaaah-to." assert.is.equal 'Whatever.', result diff --git a/exercises/practice/book-store/book_store_spec.moon b/exercises/practice/book-store/book_store_spec.moon index 4fda14a..5f7cb83 100644 --- a/exercises/practice/book-store/book_store_spec.moon +++ b/exercises/practice/book-store/book_store_spec.moon @@ -1,6 +1,6 @@ BookStore = require 'book_store' -describe 'book-store', -> +describe 'book-store:', -> it 'Only a single book', -> result = BookStore.total {1} expected = 800 diff --git a/exercises/practice/camicia/camicia_spec.moon b/exercises/practice/camicia/camicia_spec.moon index 44c14ca..98ee02e 100644 --- a/exercises/practice/camicia/camicia_spec.moon +++ b/exercises/practice/camicia/camicia_spec.moon @@ -1,6 +1,6 @@ Camicia = require 'camicia' -describe 'camicia', -> +describe 'camicia:', -> it 'two cards, one trick', -> playerA = {'2'} playerB = {'3'} diff --git a/exercises/practice/change/change_spec.moon b/exercises/practice/change/change_spec.moon index 968227f..784047c 100644 --- a/exercises/practice/change/change_spec.moon +++ b/exercises/practice/change/change_spec.moon @@ -1,6 +1,6 @@ import make_change from require 'change' -describe 'change', -> +describe 'change:', -> it 'change for 1 cent', -> result = make_change 1, {1, 5, 10, 25} expected = {1} diff --git a/exercises/practice/circular-buffer/circular_buffer_spec.moon b/exercises/practice/circular-buffer/circular_buffer_spec.moon index 7ac47c0..fa9babb 100644 --- a/exercises/practice/circular-buffer/circular_buffer_spec.moon +++ b/exercises/practice/circular-buffer/circular_buffer_spec.moon @@ -1,6 +1,6 @@ CircularBuffer = require 'circular_buffer' -describe 'circular-buffer', -> +describe 'circular-buffer:', -> it 'reading empty buffer should fail', -> buffer = CircularBuffer 1 value, ok = buffer\read! diff --git a/exercises/practice/clock/clock_spec.moon b/exercises/practice/clock/clock_spec.moon index f6845b1..ba2c956 100644 --- a/exercises/practice/clock/clock_spec.moon +++ b/exercises/practice/clock/clock_spec.moon @@ -1,7 +1,7 @@ Clock = require 'clock' -describe 'clock', -> - describe 'Create a new clock with an initial time', -> +describe 'clock:', -> + describe 'Create a new clock with an initial time:', -> it 'on the hour', -> clock = Clock hour: 8, minute: 0 assert.are.equal '08:00', tostring clock @@ -82,7 +82,7 @@ describe 'clock', -> clock = Clock hour: -121, minute: -5810 assert.are.equal '22:10', tostring clock - describe 'Add minutes', -> + describe 'Add minutes:', -> pending 'add minutes', -> clock = Clock hour: 10, minute: 0 clock\add 3 @@ -123,7 +123,7 @@ describe 'clock', -> clock\add 3500 assert.are.equal '11:21', tostring clock - describe 'Subtract minutes', -> + describe 'Subtract minutes:', -> pending 'subtract minutes', -> clock = Clock hour: 10, minute: 3 clock\subtract 3 @@ -164,7 +164,7 @@ describe 'clock', -> clock\subtract 3000 assert.are.equal '00:20', tostring clock - describe 'Compare two clocks for equality', -> + describe 'Compare two clocks for equality:', -> pending 'clocks with same time', -> a = Clock hour: 15, minute: 37 b = Clock hour: 15, minute: 37 diff --git a/exercises/practice/collatz-conjecture/collatz_conjecture_spec.moon b/exercises/practice/collatz-conjecture/collatz_conjecture_spec.moon index 2d39adc..8397990 100644 --- a/exercises/practice/collatz-conjecture/collatz_conjecture_spec.moon +++ b/exercises/practice/collatz-conjecture/collatz_conjecture_spec.moon @@ -1,6 +1,6 @@ CollatzConjecture = require 'collatz_conjecture' -describe 'collatz-conjecture', -> +describe 'collatz-conjecture:', -> it 'zero steps for one', -> result = CollatzConjecture.steps 1 assert.are.equal 0, result diff --git a/exercises/practice/complex-numbers/complex_numbers_spec.moon b/exercises/practice/complex-numbers/complex_numbers_spec.moon index 733d7db..e58b89b 100644 --- a/exercises/practice/complex-numbers/complex_numbers_spec.moon +++ b/exercises/practice/complex-numbers/complex_numbers_spec.moon @@ -1,11 +1,11 @@ import ComplexNumber, add, sub, mul, div from require 'complex_numbers' -describe 'complex-numbers', -> +describe 'complex-numbers:', -> pi = math.pi e = math.exp(1) ln = math.log - describe 'Real part', -> + describe 'Real part:', -> it 'Real part of a purely real number', -> c = ComplexNumber(1, 0) result = c\real! @@ -21,7 +21,7 @@ describe 'complex-numbers', -> result = c\real! assert.are.equal 1, result - describe 'Imaginary part', -> + describe 'Imaginary part:', -> pending 'Imaginary part of a purely real number', -> c = ComplexNumber(1, 0) result = c\imaginary! @@ -44,8 +44,8 @@ describe 'complex-numbers', -> expected = ComplexNumber(-1, 0) assert.are.equal expected, result - describe 'Arithmetic', -> - describe 'Addition', -> + describe 'Arithmetic:', -> + describe 'Addition:', -> pending 'Add purely real numbers', -> c1 = ComplexNumber(1, 0) c2 = ComplexNumber(2, 0) @@ -67,7 +67,7 @@ describe 'complex-numbers', -> expected = ComplexNumber(4, 6) assert.are.equal expected, result - describe 'Subtraction', -> + describe 'Subtraction:', -> pending 'Subtract purely real numbers', -> c1 = ComplexNumber(1, 0) c2 = ComplexNumber(2, 0) @@ -89,7 +89,7 @@ describe 'complex-numbers', -> expected = ComplexNumber(-2, -2) assert.are.equal expected, result - describe 'Multiplication', -> + describe 'Multiplication:', -> pending 'Multiply purely real numbers', -> c1 = ComplexNumber(1, 0) c2 = ComplexNumber(2, 0) @@ -111,7 +111,7 @@ describe 'complex-numbers', -> expected = ComplexNumber(-5, 10) assert.are.equal expected, result - describe 'Division', -> + describe 'Division:', -> pending 'Divide purely real numbers', -> c1 = ComplexNumber(1, 0) c2 = ComplexNumber(2, 0) @@ -133,7 +133,7 @@ describe 'complex-numbers', -> expected = ComplexNumber(0.44, 0.08) assert.are.equal expected, result - describe 'Absolute value', -> + describe 'Absolute value:', -> pending 'Absolute value of a positive purely real number', -> c = ComplexNumber(5, 0) result = c\abs! @@ -159,7 +159,7 @@ describe 'complex-numbers', -> result = c\abs! assert.are.equal 5, result - describe 'Complex conjugate', -> + describe 'Complex conjugate:', -> pending 'Conjugate a purely real number', -> c = ComplexNumber(5, 0) result = c\conjugate! @@ -178,7 +178,7 @@ describe 'complex-numbers', -> expected = ComplexNumber(1, -1) assert.are.equal expected, result - describe 'Complex exponential function', -> + describe 'Complex exponential function:', -> pending "Euler's identity/formula", -> c = ComplexNumber(0, pi) result = c\exp! @@ -209,7 +209,7 @@ describe 'complex-numbers', -> expected = ComplexNumber(1, 1) assert.are.equal expected, result - describe 'Operations between real numbers and complex numbers', -> + describe 'Operations between real numbers and complex numbers:', -> pending 'Add real number to complex number', -> result = add ComplexNumber(1, 2), 5 expected = ComplexNumber(6, 2) diff --git a/exercises/practice/connect/connect_spec.moon b/exercises/practice/connect/connect_spec.moon index 08c029b..258ad6f 100644 --- a/exercises/practice/connect/connect_spec.moon +++ b/exercises/practice/connect/connect_spec.moon @@ -1,6 +1,6 @@ Connect = require 'connect' -describe 'connect', -> +describe 'connect:', -> it 'an empty board has no winner', -> board = { '. . . . .', diff --git a/exercises/practice/crypto-square/crypto_square_spec.moon b/exercises/practice/crypto-square/crypto_square_spec.moon index 91fd5fb..f60a743 100644 --- a/exercises/practice/crypto-square/crypto_square_spec.moon +++ b/exercises/practice/crypto-square/crypto_square_spec.moon @@ -1,6 +1,6 @@ import encode from require 'crypto_square' -describe 'crypto-square', -> +describe 'crypto-square:', -> it 'empty plaintext results in an empty ciphertext', -> result = encode '' expected = '' diff --git a/exercises/practice/custom-set/custom_set_spec.moon b/exercises/practice/custom-set/custom_set_spec.moon index 568db24..2684ade 100644 --- a/exercises/practice/custom-set/custom_set_spec.moon +++ b/exercises/practice/custom-set/custom_set_spec.moon @@ -1,7 +1,7 @@ CustomSet = require 'custom_set' -describe 'custom-set', -> - describe 'Returns true if the set contains no elements', -> +describe 'custom-set:', -> + describe 'Returns true if the set contains no elements:', -> it 'sets with no elements are empty', -> set = CustomSet {} assert.is.true, set\is_empty! @@ -10,7 +10,7 @@ describe 'custom-set', -> set = CustomSet {1} assert.is.false, set\is_empty! - describe 'Sets can report if they contain an element', -> + describe 'Sets can report if they contain an element:', -> pending 'nothing is contained in an empty set', -> set = CustomSet {} assert.is.false, set\contains 1 @@ -23,7 +23,7 @@ describe 'custom-set', -> set = CustomSet {1, 2, 3} assert.is.false, set\contains 4 - describe 'A set is a subset if all of its elements are contained in the other set', -> + describe 'A set is a subset if all of its elements are contained in the other set:', -> pending 'empty set is a subset of another empty set', -> set1 = CustomSet {} set2 = CustomSet {} @@ -54,7 +54,7 @@ describe 'custom-set', -> set2 = CustomSet {4, 1, 3} assert.is.false, set1\is_subset set2 - describe 'Sets are disjoint if they share no elements', -> + describe 'Sets are disjoint if they share no elements:', -> pending 'the empty set is disjoint with itself', -> set1 = CustomSet {} set2 = CustomSet {} @@ -80,7 +80,7 @@ describe 'custom-set', -> set2 = CustomSet {3, 4} assert.is.true, set1\is_disjoint set2 - describe 'Sets with the same elements are equal', -> + describe 'Sets with the same elements are equal:', -> pending 'empty sets are equal', -> set1 = CustomSet {} set2 = CustomSet {} @@ -116,7 +116,7 @@ describe 'custom-set', -> set2 = CustomSet {1, 1} assert.is.true, set1\is_equal set2 - describe 'Unique elements can be added to a set', -> + describe 'Unique elements can be added to a set:', -> pending 'add to empty set', -> set = CustomSet {} set\add 3 @@ -135,7 +135,7 @@ describe 'custom-set', -> expected = CustomSet {1, 2, 3} assert.is.true set\is_equal expected - describe 'Intersection returns a set of all shared elements', -> + describe 'Intersection returns a set of all shared elements:', -> pending 'intersection of two empty sets is an empty set', -> set1 = CustomSet {} set2 = CustomSet {} @@ -171,7 +171,7 @@ describe 'custom-set', -> expected = CustomSet {2, 3} assert.is.true result\is_equal expected - describe 'Difference (or Complement) of a set is a set of all elements that are only in the first set', -> + describe 'Difference (or Complement) of a set is a set of all elements that are only in the first set:', -> pending 'difference of two empty sets is an empty set', -> set1 = CustomSet {} set2 = CustomSet {} @@ -207,7 +207,7 @@ describe 'custom-set', -> expected = CustomSet {} assert.is.true result\is_equal expected - describe 'Union returns a set of all elements in either set', -> + describe 'Union returns a set of all elements in either set:', -> pending 'union of empty sets is an empty set', -> set1 = CustomSet {} set2 = CustomSet {} diff --git a/exercises/practice/darts/darts_spec.moon b/exercises/practice/darts/darts_spec.moon index 650699b..720842f 100644 --- a/exercises/practice/darts/darts_spec.moon +++ b/exercises/practice/darts/darts_spec.moon @@ -1,6 +1,6 @@ darts = require 'darts' -describe 'darts', -> +describe 'darts:', -> it 'Missed target', -> result = darts.score -9, 9 assert.are.equal 0, result diff --git a/exercises/practice/diamond/diamond_spec.moon b/exercises/practice/diamond/diamond_spec.moon index 41fc551..0c85c0b 100644 --- a/exercises/practice/diamond/diamond_spec.moon +++ b/exercises/practice/diamond/diamond_spec.moon @@ -1,6 +1,6 @@ Diamond = require 'diamond' -describe 'diamond', -> +describe 'diamond:', -> it "Degenerate case with a single 'A' row", -> result = Diamond.rows 'A' expected = {'A'} diff --git a/exercises/practice/difference-of-squares/difference_of_squares_spec.moon b/exercises/practice/difference-of-squares/difference_of_squares_spec.moon index bcea105..a7fce87 100644 --- a/exercises/practice/difference-of-squares/difference_of_squares_spec.moon +++ b/exercises/practice/difference-of-squares/difference_of_squares_spec.moon @@ -1,7 +1,7 @@ DifferenceOfSquares = require 'difference_of_squares' -describe 'difference-of-squares', -> - describe 'Square the sum of the numbers up to the given number', -> +describe 'difference-of-squares:', -> + describe 'Square the sum of the numbers up to the given number:', -> it 'square of sum 1', -> result = DifferenceOfSquares.square_of_sum 1 assert.are.equal 1, result @@ -14,7 +14,7 @@ describe 'difference-of-squares', -> result = DifferenceOfSquares.square_of_sum 100 assert.are.equal 25502500, result - describe 'Sum the squares of the numbers up to the given number', -> + describe 'Sum the squares of the numbers up to the given number:', -> pending 'sum of squares 1', -> result = DifferenceOfSquares.sum_of_squares 1 assert.are.equal 1, result @@ -27,7 +27,7 @@ describe 'difference-of-squares', -> result = DifferenceOfSquares.sum_of_squares 100 assert.are.equal 338350, result - describe 'Subtract sum of squares from square of sums', -> + describe 'Subtract sum of squares from square of sums:', -> pending 'difference of squares 1', -> result = DifferenceOfSquares.difference_of_squares 1 assert.are.equal 0, result diff --git a/exercises/practice/dnd-character/dnd_character_spec.moon b/exercises/practice/dnd-character/dnd_character_spec.moon index 6c95115..cfb98cb 100644 --- a/exercises/practice/dnd-character/dnd_character_spec.moon +++ b/exercises/practice/dnd-character/dnd_character_spec.moon @@ -1,6 +1,6 @@ import modifier, ability, character from require 'dnd_character' -describe 'dnd-character', -> +describe 'dnd-character:', -> -- ---------------------------------------------------------- between = (state, arguments) -> assert #arguments == 3, 'expected three arguments to assert.between: value, min, max' @@ -13,7 +13,7 @@ describe 'dnd-character', -> assert\register 'assertion', 'between', between, 'assertion.between.positive', 'assertion.between.negative' -- ---------------------------------------------------------- - describe 'ability modifier', -> + describe 'ability modifier:', -> it 'ability modifier for score 3 is -4', -> assert.are.equal -4, modifier 3 diff --git a/exercises/practice/dominoes/dominoes_spec.moon b/exercises/practice/dominoes/dominoes_spec.moon index b8f372e..bf24ae0 100644 --- a/exercises/practice/dominoes/dominoes_spec.moon +++ b/exercises/practice/dominoes/dominoes_spec.moon @@ -1,6 +1,6 @@ import canChain from require 'dominoes' -describe 'dominoes', -> +describe 'dominoes:', -> it 'empty input = empty output', -> dominoes = {} assert.is.true canChain dominoes diff --git a/exercises/practice/eliuds-eggs/eliuds_eggs_spec.moon b/exercises/practice/eliuds-eggs/eliuds_eggs_spec.moon index cc3de22..bf78d95 100644 --- a/exercises/practice/eliuds-eggs/eliuds_eggs_spec.moon +++ b/exercises/practice/eliuds-eggs/eliuds_eggs_spec.moon @@ -1,6 +1,6 @@ count_eggs = require 'eliuds_eggs' -describe 'eliuds-eggs', -> +describe 'eliuds-eggs:', -> it '0 eggs', -> result = count_eggs 0 assert.are.equal 0, result diff --git a/exercises/practice/etl/etl_spec.moon b/exercises/practice/etl/etl_spec.moon index d1ffb23..45aabbe 100644 --- a/exercises/practice/etl/etl_spec.moon +++ b/exercises/practice/etl/etl_spec.moon @@ -1,6 +1,6 @@ Etl = require 'etl' -describe 'etl', -> +describe 'etl:', -> it 'single letter', -> legacy = { '1': {'A'} diff --git a/exercises/practice/flatten-array/flatten_array_spec.moon b/exercises/practice/flatten-array/flatten_array_spec.moon index 1661e95..a3f2040 100644 --- a/exercises/practice/flatten-array/flatten_array_spec.moon +++ b/exercises/practice/flatten-array/flatten_array_spec.moon @@ -1,6 +1,6 @@ import flatten from require 'flatten_array' -describe 'flatten-array', -> +describe 'flatten-array:', -> it 'empty', -> input = {} expected = {} diff --git a/exercises/practice/flower-field/flower_field_spec.moon b/exercises/practice/flower-field/flower_field_spec.moon index fd6f0f1..b5416ff 100644 --- a/exercises/practice/flower-field/flower_field_spec.moon +++ b/exercises/practice/flower-field/flower_field_spec.moon @@ -1,6 +1,6 @@ FlowerField = require 'flower_field' -describe 'flower-field', -> +describe 'flower-field:', -> it 'no rows', -> garden = {} expected = {} diff --git a/exercises/practice/food-chain/food_chain_spec.moon b/exercises/practice/food-chain/food_chain_spec.moon index 5cea93a..c129547 100644 --- a/exercises/practice/food-chain/food_chain_spec.moon +++ b/exercises/practice/food-chain/food_chain_spec.moon @@ -1,6 +1,6 @@ FoodChain = require 'food_chain' -describe 'food-chain', -> +describe 'food-chain:', -> it 'fly', -> result = FoodChain.recite 1, 1 expected = {'I know an old lady who swallowed a fly.', "I don't know why she swallowed the fly. Perhaps she'll die."} diff --git a/exercises/practice/forth/forth_spec.moon b/exercises/practice/forth/forth_spec.moon index 1d61125..556a20c 100644 --- a/exercises/practice/forth/forth_spec.moon +++ b/exercises/practice/forth/forth_spec.moon @@ -1,7 +1,7 @@ Forth = require 'forth' -describe 'forth', -> - describe 'parsing and numbers', -> +describe 'forth:', -> + describe 'parsing and numbers:', -> it 'numbers just get pushed onto the stack', -> interpreter = Forth! instructions = {'1 2 3 4 5'} @@ -16,7 +16,7 @@ describe 'forth', -> expected = {-1, -2, -3, -4, -5} assert.is.same expected, interpreter\stack! - describe 'addition', -> + describe 'addition:', -> pending 'can add two numbers', -> interpreter = Forth! instructions = {'1 2 +'} @@ -43,7 +43,7 @@ describe 'forth', -> expected = {1, 5} assert.is.same expected, interpreter\stack! - describe 'subtraction', -> + describe 'subtraction:', -> pending 'can subtract two numbers', -> interpreter = Forth! instructions = {'3 4 -'} @@ -70,7 +70,7 @@ describe 'forth', -> expected = {1, 9} assert.is.same expected, interpreter\stack! - describe 'multiplication', -> + describe 'multiplication:', -> pending 'can multiply two numbers', -> interpreter = Forth! instructions = {'2 4 *'} @@ -97,7 +97,7 @@ describe 'forth', -> expected = {1, 6} assert.is.same expected, interpreter\stack! - describe 'division', -> + describe 'division:', -> pending 'can divide two numbers', -> interpreter = Forth! instructions = {'12 3 /'} @@ -137,7 +137,7 @@ describe 'forth', -> expected = {1, 4} assert.is.same expected, interpreter\stack! - describe 'combined arithmetic', -> + describe 'combined arithmetic:', -> pending 'addition and subtraction', -> interpreter = Forth! instructions = {'1 2 + 4 -'} @@ -166,7 +166,7 @@ describe 'forth', -> expected = {7} assert.is.same expected, interpreter\stack! - describe 'dup', -> + describe 'dup:', -> pending 'copies a value on the stack', -> interpreter = Forth! instructions = {'1 dup'} @@ -187,7 +187,7 @@ describe 'forth', -> f = -> interpreter\evaluate instructions assert.has.errors f, 'empty stack' - describe 'drop', -> + describe 'drop:', -> pending 'removes the top value on the stack if it is the only one', -> interpreter = Forth! instructions = {'1 drop'} @@ -208,7 +208,7 @@ describe 'forth', -> f = -> interpreter\evaluate instructions assert.has.errors f, 'empty stack' - describe 'swap', -> + describe 'swap:', -> pending 'swaps the top two values on the stack if they are the only ones', -> interpreter = Forth! instructions = {'1 2 swap'} @@ -235,7 +235,7 @@ describe 'forth', -> f = -> interpreter\evaluate instructions assert.has.errors f, 'only one value on the stack' - describe 'over', -> + describe 'over:', -> pending 'copies the second element if there are only two', -> interpreter = Forth! instructions = {'1 2 over'} @@ -262,7 +262,7 @@ describe 'forth', -> f = -> interpreter\evaluate instructions assert.has.errors f, 'only one value on the stack' - describe 'user-defined words', -> + describe 'user-defined words:', -> pending 'can consist of built-in words', -> interpreter = Forth! instructions = {': dup-twice dup dup ;', '1 dup-twice'} @@ -351,7 +351,7 @@ describe 'forth', -> assert.are.same {0}, interp1\stack! assert.are.same {2}, interp2\stack! - describe 'case-insensitivity', -> + describe 'case-insensitivity:', -> pending 'DUP is case-insensitive', -> interpreter = Forth! instructions = {'1 DUP Dup dup'} diff --git a/exercises/practice/game-of-life/game_of_life_spec.moon b/exercises/practice/game-of-life/game_of_life_spec.moon index 1d29924..7f8ce8c 100644 --- a/exercises/practice/game-of-life/game_of_life_spec.moon +++ b/exercises/practice/game-of-life/game_of_life_spec.moon @@ -1,6 +1,6 @@ GameOfLife = require 'game_of_life' -describe 'game-of-life', -> +describe 'game-of-life:', -> it 'empty matrix', -> matrix = {} result = GameOfLife.tick matrix diff --git a/exercises/practice/gigasecond/gigasecond_spec.moon b/exercises/practice/gigasecond/gigasecond_spec.moon index b15a05a..10ccadd 100644 --- a/exercises/practice/gigasecond/gigasecond_spec.moon +++ b/exercises/practice/gigasecond/gigasecond_spec.moon @@ -1,6 +1,6 @@ Gigasecond = require 'gigasecond' -describe 'gigasecond', -> +describe 'gigasecond:', -> it 'date only specification of time', -> result = Gigasecond.add '2011-04-25' expected = '2043-01-01T01:46:40' diff --git a/exercises/practice/grade-school/grade_school_spec.moon b/exercises/practice/grade-school/grade_school_spec.moon index 013adbe..7677571 100644 --- a/exercises/practice/grade-school/grade_school_spec.moon +++ b/exercises/practice/grade-school/grade_school_spec.moon @@ -1,6 +1,6 @@ import roster, add, grade from require 'grade_school' -describe 'grade-school', -> +describe 'grade-school:', -> it 'Roster is empty when no student is added', -> result = roster {} expected = {} diff --git a/exercises/practice/grains/grains_spec.moon b/exercises/practice/grains/grains_spec.moon index df553ee..fba85ec 100644 --- a/exercises/practice/grains/grains_spec.moon +++ b/exercises/practice/grains/grains_spec.moon @@ -1,7 +1,7 @@ Grains = require 'grains' -describe 'grains', -> - describe 'returns the number of grains on the square', -> +describe 'grains:', -> + describe 'returns the number of grains on the square:', -> it 'grains on square 1', -> assert.are.equal 1, Grains.square 1 diff --git a/exercises/practice/hamming/hamming_spec.moon b/exercises/practice/hamming/hamming_spec.moon index d506039..9505b25 100644 --- a/exercises/practice/hamming/hamming_spec.moon +++ b/exercises/practice/hamming/hamming_spec.moon @@ -1,6 +1,6 @@ hamming = require 'hamming' -describe 'hamming', -> +describe 'hamming:', -> it 'empty strands', -> result = hamming.distance '', '' assert.are.equal 0, result diff --git a/exercises/practice/hello-world/.meta/spec_generator.moon b/exercises/practice/hello-world/.meta/spec_generator.moon new file mode 100644 index 0000000..23f6bee --- /dev/null +++ b/exercises/practice/hello-world/.meta/spec_generator.moon @@ -0,0 +1 @@ +error 'hello-world does not use a generator. Please update spec by hand.' diff --git a/exercises/practice/high-scores/high_scores_spec.moon b/exercises/practice/high-scores/high_scores_spec.moon index 51dee8b..3e3f728 100644 --- a/exercises/practice/high-scores/high_scores_spec.moon +++ b/exercises/practice/high-scores/high_scores_spec.moon @@ -1,6 +1,6 @@ HighScores = require 'high_scores' -describe 'high-scores', -> +describe 'high-scores:', -> it 'List of scores', -> scores = HighScores {30, 50, 20, 70} result = scores\scores! @@ -19,7 +19,7 @@ describe 'high-scores', -> expected = 100 assert.are.same expected, result - describe 'Top 3 scores', -> + describe 'Top 3 scores:', -> pending 'Personal top three from a list of scores', -> scores = HighScores {10, 30, 90, 30, 100, 20, 10, 0, 30, 40, 40, 70, 70} result = scores\personalTopThree! diff --git a/exercises/practice/house/house_spec.moon b/exercises/practice/house/house_spec.moon index bcf5028..fe14f6f 100644 --- a/exercises/practice/house/house_spec.moon +++ b/exercises/practice/house/house_spec.moon @@ -1,6 +1,6 @@ House = require 'house' -describe 'house', -> +describe 'house:', -> it 'verse one - the house that jack built', -> result = House.recite 1, 1 expected = {'This is the house that Jack built.'} diff --git a/exercises/practice/isbn-verifier/isbn_verifier_spec.moon b/exercises/practice/isbn-verifier/isbn_verifier_spec.moon index dee9bd1..7f80599 100644 --- a/exercises/practice/isbn-verifier/isbn_verifier_spec.moon +++ b/exercises/practice/isbn-verifier/isbn_verifier_spec.moon @@ -1,6 +1,6 @@ Isbn10 = require 'isbn_verifier' -describe 'isbn-verifier', -> +describe 'isbn-verifier:', -> it 'valid isbn', -> assert.is_true Isbn10.is_valid '3-598-21508-8' diff --git a/exercises/practice/isogram/isogram_spec.moon b/exercises/practice/isogram/isogram_spec.moon index 57de1d0..a58e0b8 100644 --- a/exercises/practice/isogram/isogram_spec.moon +++ b/exercises/practice/isogram/isogram_spec.moon @@ -1,6 +1,6 @@ import is_isogram from require 'isogram' -describe 'isogram', -> +describe 'isogram:', -> it 'empty string', -> assert.is_true is_isogram '' diff --git a/exercises/practice/kindergarten-garden/.meta/.spec_generator.moon b/exercises/practice/kindergarten-garden/.meta/.spec_generator.moon deleted file mode 100644 index 78627d3..0000000 --- a/exercises/practice/kindergarten-garden/.meta/.spec_generator.moon +++ /dev/null @@ -1,24 +0,0 @@ --- glennj: I used this to create the spec from the canonical data --- but then I noticed that, by forcing an object to be created from --- the diagram, the same object can be used to query each student. --- So, we'll stick with the hand-mofified specs now. -return nil - -json = require 'dkjson' -json_string = (s) -> json.encode s - -list_of_words = (list) -> - "{#{table.concat [quote word for word in *list], ', '}}" - -{ - module_name: 'KindergartenGarden', - - generate_test: (case, level) -> - lines = { - "garden = KindergartenGarden #{json_string case.input.diagram}", - "result = garden\\#{case.property} #{quote case.input.student}", - "expected = #{list_of_words case.expected}", - "assert.are.same expected, result" - } - table.concat [indent line, level for line in *lines], '\n' -} diff --git a/exercises/practice/kindergarten-garden/.meta/spec_generator.moon b/exercises/practice/kindergarten-garden/.meta/spec_generator.moon index 485905b..87d399e 100644 --- a/exercises/practice/kindergarten-garden/.meta/spec_generator.moon +++ b/exercises/practice/kindergarten-garden/.meta/spec_generator.moon @@ -1,3 +1 @@ error 'kindergarten-garden does not use a generator. Please update spec by hand.' - --- see file ./.spec_generator.moon diff --git a/exercises/practice/knapsack/knapsack_spec.moon b/exercises/practice/knapsack/knapsack_spec.moon index 112c89a..3f92024 100644 --- a/exercises/practice/knapsack/knapsack_spec.moon +++ b/exercises/practice/knapsack/knapsack_spec.moon @@ -1,6 +1,6 @@ import maximumValue from require 'knapsack' -describe 'knapsack', -> +describe 'knapsack:', -> it 'no items', -> items = {} maxWeight = 100 @@ -8,18 +8,18 @@ describe 'knapsack', -> assert.are.equal 0, result pending 'one item, too heavy', -> - items = {{value: 1, weight: 100}} + items = {{weight: 100, value: 1}} maxWeight = 10 result = maximumValue maxWeight, items assert.are.equal 0, result pending 'five items (cannot be greedy by weight)', -> items = { - {value: 5, weight: 2}, - {value: 5, weight: 2}, - {value: 5, weight: 2}, - {value: 5, weight: 2}, - {value: 21, weight: 10}, + {weight: 2, value: 5}, + {weight: 2, value: 5}, + {weight: 2, value: 5}, + {weight: 2, value: 5}, + {weight: 10, value: 21}, } maxWeight = 10 result = maximumValue maxWeight, items @@ -27,11 +27,11 @@ describe 'knapsack', -> pending 'five items (cannot be greedy by value)', -> items = { - {value: 20, weight: 2}, - {value: 20, weight: 2}, - {value: 20, weight: 2}, - {value: 20, weight: 2}, - {value: 50, weight: 10}, + {weight: 2, value: 20}, + {weight: 2, value: 20}, + {weight: 2, value: 20}, + {weight: 2, value: 20}, + {weight: 10, value: 50}, } maxWeight = 10 result = maximumValue maxWeight, items @@ -39,10 +39,10 @@ describe 'knapsack', -> pending 'example knapsack', -> items = { - {value: 10, weight: 5}, - {value: 40, weight: 4}, - {value: 30, weight: 6}, - {value: 50, weight: 4}, + {weight: 5, value: 10}, + {weight: 4, value: 40}, + {weight: 6, value: 30}, + {weight: 4, value: 50}, } maxWeight = 10 result = maximumValue maxWeight, items @@ -50,14 +50,14 @@ describe 'knapsack', -> pending '8 items', -> items = { - {value: 350, weight: 25}, - {value: 400, weight: 35}, - {value: 450, weight: 45}, - {value: 20, weight: 5}, - {value: 70, weight: 25}, - {value: 8, weight: 3}, - {value: 5, weight: 2}, - {value: 5, weight: 2}, + {weight: 25, value: 350}, + {weight: 35, value: 400}, + {weight: 45, value: 450}, + {weight: 5, value: 20}, + {weight: 25, value: 70}, + {weight: 3, value: 8}, + {weight: 2, value: 5}, + {weight: 2, value: 5}, } maxWeight = 104 result = maximumValue maxWeight, items @@ -65,21 +65,21 @@ describe 'knapsack', -> pending '15 items', -> items = { - {value: 135, weight: 70}, - {value: 139, weight: 73}, - {value: 149, weight: 77}, - {value: 150, weight: 80}, - {value: 156, weight: 82}, - {value: 163, weight: 87}, - {value: 173, weight: 90}, - {value: 184, weight: 94}, - {value: 192, weight: 98}, - {value: 201, weight: 106}, - {value: 210, weight: 110}, - {value: 214, weight: 113}, - {value: 221, weight: 115}, - {value: 229, weight: 118}, - {value: 240, weight: 120}, + {weight: 70, value: 135}, + {weight: 73, value: 139}, + {weight: 77, value: 149}, + {weight: 80, value: 150}, + {weight: 82, value: 156}, + {weight: 87, value: 163}, + {weight: 90, value: 173}, + {weight: 94, value: 184}, + {weight: 98, value: 192}, + {weight: 106, value: 201}, + {weight: 110, value: 210}, + {weight: 113, value: 214}, + {weight: 115, value: 221}, + {weight: 118, value: 229}, + {weight: 120, value: 240}, } maxWeight = 750 result = maximumValue maxWeight, items diff --git a/exercises/practice/largest-series-product/largest_series_product_spec.moon b/exercises/practice/largest-series-product/largest_series_product_spec.moon index 237e6ed..dcbd725 100644 --- a/exercises/practice/largest-series-product/largest_series_product_spec.moon +++ b/exercises/practice/largest-series-product/largest_series_product_spec.moon @@ -1,6 +1,6 @@ import largest_product from require 'largest_series_product' -describe 'largest-series-product', -> +describe 'largest-series-product:', -> it 'finds the largest product if span equals length', -> result = largest_product '29', 2 assert.are.equal 18, result diff --git a/exercises/practice/leap/leap_spec.moon b/exercises/practice/leap/leap_spec.moon index b60f7a6..632dc81 100644 --- a/exercises/practice/leap/leap_spec.moon +++ b/exercises/practice/leap/leap_spec.moon @@ -1,6 +1,6 @@ is_leap_year = require 'leap' -describe 'leap', -> +describe 'leap:', -> it 'year not divisible by 4 in common year', -> assert.is_false is_leap_year 2015 diff --git a/exercises/practice/line-up/line_up_spec.moon b/exercises/practice/line-up/line_up_spec.moon index f784c9c..4f1259a 100644 --- a/exercises/practice/line-up/line_up_spec.moon +++ b/exercises/practice/line-up/line_up_spec.moon @@ -1,6 +1,6 @@ LineUp = require 'line_up' -describe 'line-up', -> +describe 'line-up:', -> it 'format smallest non-exceptional ordinal numeral 4', -> result = LineUp.format 'Gianna', 4 expected = 'Gianna, you are the 4th customer we serve today. Thank you!' diff --git a/exercises/practice/linked-list/linked_list_spec.moon b/exercises/practice/linked-list/linked_list_spec.moon index 6333dfb..7415d0a 100644 --- a/exercises/practice/linked-list/linked_list_spec.moon +++ b/exercises/practice/linked-list/linked_list_spec.moon @@ -1,6 +1,6 @@ LinkedList = require 'linked_list' -describe 'linked-list', -> +describe 'linked-list:', -> it 'pop gets element from the list', -> list = LinkedList! list\push 7 diff --git a/exercises/practice/luhn/luhn_spec.moon b/exercises/practice/luhn/luhn_spec.moon index 8a826fa..3287abf 100644 --- a/exercises/practice/luhn/luhn_spec.moon +++ b/exercises/practice/luhn/luhn_spec.moon @@ -1,6 +1,6 @@ Luhn = require 'luhn' -describe 'luhn', -> +describe 'luhn:', -> it 'single digit strings can not be valid', -> assert.is_false Luhn.is_valid '1' diff --git a/exercises/practice/markdown/markdown_spec.moon b/exercises/practice/markdown/markdown_spec.moon index 131d4ef..57922c1 100644 --- a/exercises/practice/markdown/markdown_spec.moon +++ b/exercises/practice/markdown/markdown_spec.moon @@ -1,6 +1,6 @@ Markdown = require 'markdown' -describe 'markdown', -> +describe 'markdown:', -> it 'parses normal text as a paragraph', -> result = Markdown.parse "This will be a paragraph" expected = '

This will be a paragraph

' diff --git a/exercises/practice/matching-brackets/matching_brackets_spec.moon b/exercises/practice/matching-brackets/matching_brackets_spec.moon index 840fec4..48b6c4f 100644 --- a/exercises/practice/matching-brackets/matching_brackets_spec.moon +++ b/exercises/practice/matching-brackets/matching_brackets_spec.moon @@ -1,6 +1,6 @@ import is_paired from require 'matching_brackets' -describe 'matching-brackets', -> +describe 'matching-brackets:', -> it 'paired square brackets', -> assert.is_true is_paired '[]' diff --git a/exercises/practice/matrix/matrix_spec.moon b/exercises/practice/matrix/matrix_spec.moon index c6c0ab0..17b49aa 100644 --- a/exercises/practice/matrix/matrix_spec.moon +++ b/exercises/practice/matrix/matrix_spec.moon @@ -1,6 +1,6 @@ Matrix = require 'matrix' -describe 'matrix', -> +describe 'matrix:', -> it 'extract row from one number matrix', -> result = Matrix.row "1", 1 expected = {1} diff --git a/exercises/practice/meetup/meetup_spec.moon b/exercises/practice/meetup/meetup_spec.moon index 396818d..f75c50e 100644 --- a/exercises/practice/meetup/meetup_spec.moon +++ b/exercises/practice/meetup/meetup_spec.moon @@ -1,6 +1,6 @@ import meetup from require 'meetup' -describe 'meetup', -> +describe 'meetup:', -> it 'when teenth Monday is the 13th, the first day of the teenth week', -> result = meetup {year: 2013, month: 5, week: "teenth", dayofweek: "Monday"} expected = '2013-05-13' diff --git a/exercises/practice/micro-blog/micro_blog_spec.moon b/exercises/practice/micro-blog/micro_blog_spec.moon index 81f38fe..699495e 100644 --- a/exercises/practice/micro-blog/micro_blog_spec.moon +++ b/exercises/practice/micro-blog/micro_blog_spec.moon @@ -1,6 +1,6 @@ MicroBlog = require 'micro_blog' -describe 'micro-blog', -> +describe 'micro-blog:', -> it 'English language short', -> result = MicroBlog.truncate 'Hi' assert.are.equal 'Hi', result diff --git a/exercises/practice/nth-prime/nth_prime_spec.moon b/exercises/practice/nth-prime/nth_prime_spec.moon index 37974b7..5e3690a 100644 --- a/exercises/practice/nth-prime/nth_prime_spec.moon +++ b/exercises/practice/nth-prime/nth_prime_spec.moon @@ -1,6 +1,6 @@ import prime from require 'nth_prime' -describe 'nth-prime', -> +describe 'nth-prime:', -> it 'first prime', -> assert.are.equal 2, prime 1 diff --git a/exercises/practice/nucleotide-count/nucleotide_count_spec.moon b/exercises/practice/nucleotide-count/nucleotide_count_spec.moon index 47a4a10..1737bfa 100644 --- a/exercises/practice/nucleotide-count/nucleotide_count_spec.moon +++ b/exercises/practice/nucleotide-count/nucleotide_count_spec.moon @@ -1,6 +1,6 @@ nucleotide_count = require 'nucleotide_count' -describe 'nucleotide-count', -> +describe 'nucleotide-count:', -> it 'empty strand', -> expected = {A: 0, C: 0, G: 0, T: 0} result = nucleotide_count '' diff --git a/exercises/practice/palindrome-products/palindrome_products_spec.moon b/exercises/practice/palindrome-products/palindrome_products_spec.moon index ccdf035..97e12b8 100644 --- a/exercises/practice/palindrome-products/palindrome_products_spec.moon +++ b/exercises/practice/palindrome-products/palindrome_products_spec.moon @@ -1,6 +1,6 @@ PalindromeProducts = require 'palindrome_products' -describe 'palindrome-products', -> +describe 'palindrome-products:', -> it 'find the smallest palindrome from single digit factors', -> palindrome, factors = PalindromeProducts.smallest 1, 9 expected_palindrome = 1 diff --git a/exercises/practice/pangram/pangram_spec.moon b/exercises/practice/pangram/pangram_spec.moon index a30c2b2..1493b17 100644 --- a/exercises/practice/pangram/pangram_spec.moon +++ b/exercises/practice/pangram/pangram_spec.moon @@ -1,6 +1,6 @@ is_pangram = require 'pangram' -describe 'pangram', -> +describe 'pangram:', -> it 'empty sentence', -> result = is_pangram '' assert.is_false result diff --git a/exercises/practice/pascals-triangle/pascals_triangle_spec.moon b/exercises/practice/pascals-triangle/pascals_triangle_spec.moon index 490b978..f7f4215 100644 --- a/exercises/practice/pascals-triangle/pascals_triangle_spec.moon +++ b/exercises/practice/pascals-triangle/pascals_triangle_spec.moon @@ -1,6 +1,6 @@ PascalsTriangle = require 'pascals_triangle' -describe 'pascals-triangle', -> +describe 'pascals-triangle:', -> it 'zero rows', -> result = PascalsTriangle.rows 0 expected = {} diff --git a/exercises/practice/perfect-numbers/perfect_numbers_spec.moon b/exercises/practice/perfect-numbers/perfect_numbers_spec.moon index e579a46..10989dd 100644 --- a/exercises/practice/perfect-numbers/perfect_numbers_spec.moon +++ b/exercises/practice/perfect-numbers/perfect_numbers_spec.moon @@ -1,7 +1,7 @@ import classify from require 'perfect_numbers' -describe 'perfect-numbers', -> - describe 'Perfect numbers', -> +describe 'perfect-numbers:', -> + describe 'Perfect numbers:', -> it 'Smallest perfect number is classified correctly', -> assert.are.equal 'perfect', classify 6 @@ -11,7 +11,7 @@ describe 'perfect-numbers', -> pending 'Large perfect number is classified correctly', -> assert.are.equal 'perfect', classify 33550336 - describe 'Abundant numbers', -> + describe 'Abundant numbers:', -> pending 'Smallest abundant number is classified correctly', -> assert.are.equal 'abundant', classify 12 @@ -24,7 +24,7 @@ describe 'perfect-numbers', -> pending 'Perfect square abundant number is classified correctly', -> assert.are.equal 'abundant', classify 196 - describe 'Deficient numbers', -> + describe 'Deficient numbers:', -> pending 'Smallest prime deficient number is classified correctly', -> assert.are.equal 'deficient', classify 2 @@ -40,7 +40,7 @@ describe 'perfect-numbers', -> pending 'Edge case (no factors other than itself) is classified correctly', -> assert.are.equal 'deficient', classify 1 - describe 'Invalid inputs', -> + describe 'Invalid inputs:', -> pending 'Zero is rejected (as it is not a positive integer)', -> func = -> classify 0 assert.has.error func, 'Classification is only possible for positive integers.' diff --git a/exercises/practice/phone-number/phone_number_spec.moon b/exercises/practice/phone-number/phone_number_spec.moon index 49d1db5..42f1534 100644 --- a/exercises/practice/phone-number/phone_number_spec.moon +++ b/exercises/practice/phone-number/phone_number_spec.moon @@ -1,6 +1,6 @@ import clean from require 'phone_number' -describe 'phone-number', -> +describe 'phone-number:', -> it 'cleans the number', -> result = clean '(223) 456-7890' assert.is.equal '2234567890', result diff --git a/exercises/practice/pig-latin/pig_latin_spec.moon b/exercises/practice/pig-latin/pig_latin_spec.moon index d186621..dd8e8ab 100644 --- a/exercises/practice/pig-latin/pig_latin_spec.moon +++ b/exercises/practice/pig-latin/pig_latin_spec.moon @@ -1,7 +1,7 @@ import translate from require 'pig_latin' -describe 'pig-latin', -> - describe 'ay is added to words that start with vowels', -> +describe 'pig-latin:', -> + describe 'ay is added to words that start with vowels:', -> it 'word beginning with a', -> assert.are.equal 'appleay', translate 'apple' @@ -20,7 +20,7 @@ describe 'pig-latin', -> pending 'word beginning with a vowel and followed by a qu', -> assert.are.equal 'equalay', translate 'equal' - describe 'first letter and ay are moved to the end of words that start with consonants', -> + describe 'first letter and ay are moved to the end of words that start with consonants:', -> pending 'word beginning with p', -> assert.are.equal 'igpay', translate 'pig' @@ -36,7 +36,7 @@ describe 'pig-latin', -> pending 'word beginning with consonant and vowel containing qu', -> assert.are.equal 'iquidlay', translate 'liquid' - describe 'some letter clusters are treated like a single consonant', -> + describe 'some letter clusters are treated like a single consonant:', -> pending 'word beginning with ch', -> assert.are.equal 'airchay', translate 'chair' @@ -55,14 +55,14 @@ describe 'pig-latin', -> pending 'word beginning with sch', -> assert.are.equal 'oolschay', translate 'school' - describe 'some letter clusters are treated like a single vowel', -> + describe 'some letter clusters are treated like a single vowel:', -> pending 'word beginning with yt', -> assert.are.equal 'yttriaay', translate 'yttria' pending 'word beginning with xr', -> assert.are.equal 'xrayay', translate 'xray' - describe 'position of y in a word determines if it is a consonant or a vowel', -> + describe 'position of y in a word determines if it is a consonant or a vowel:', -> pending 'y is treated like a consonant at the beginning of a word', -> assert.are.equal 'ellowyay', translate 'yellow' @@ -72,6 +72,6 @@ describe 'pig-latin', -> pending 'y as second letter in two letter word', -> assert.are.equal 'ymay', translate 'my' - describe 'phrases are translated', -> + describe 'phrases are translated:', -> pending 'a whole phrase', -> assert.are.equal 'ickquay astfay unray', translate 'quick fast run' diff --git a/exercises/practice/prime-factors/prime_factors_spec.moon b/exercises/practice/prime-factors/prime_factors_spec.moon index bb80365..e7189d6 100644 --- a/exercises/practice/prime-factors/prime_factors_spec.moon +++ b/exercises/practice/prime-factors/prime_factors_spec.moon @@ -1,6 +1,6 @@ import factors from require 'prime_factors' -describe 'prime-factors', -> +describe 'prime-factors:', -> it 'no factors', -> expected = {} result = factors 1 diff --git a/exercises/practice/prism/prism_spec.moon b/exercises/practice/prism/prism_spec.moon index df32e77..c06621d 100644 --- a/exercises/practice/prism/prism_spec.moon +++ b/exercises/practice/prism/prism_spec.moon @@ -1,6 +1,6 @@ Prism = require 'prism' -describe 'prism', -> +describe 'prism:', -> it 'zero prisms', -> start = {x: 0, y: 0, angle: 0} prisms = {} diff --git a/exercises/practice/protein-translation/protein_translation_spec.moon b/exercises/practice/protein-translation/protein_translation_spec.moon index b0363fb..11d167a 100644 --- a/exercises/practice/protein-translation/protein_translation_spec.moon +++ b/exercises/practice/protein-translation/protein_translation_spec.moon @@ -1,6 +1,6 @@ import proteins from require 'protein_translation' -describe 'protein-translation', -> +describe 'protein-translation:', -> it 'Empty RNA sequence results in no proteins', -> result = proteins '' expected = {} diff --git a/exercises/practice/proverb/proverb_spec.moon b/exercises/practice/proverb/proverb_spec.moon index e8faf8a..a4c0ddb 100644 --- a/exercises/practice/proverb/proverb_spec.moon +++ b/exercises/practice/proverb/proverb_spec.moon @@ -1,6 +1,6 @@ recite = require 'proverb' -describe 'proverb', -> +describe 'proverb:', -> it 'zero pieces', -> result = recite {} expected = '' diff --git a/exercises/practice/pythagorean-triplet/pythagorean_triplet_spec.moon b/exercises/practice/pythagorean-triplet/pythagorean_triplet_spec.moon index 3408a1e..c71a82e 100644 --- a/exercises/practice/pythagorean-triplet/pythagorean_triplet_spec.moon +++ b/exercises/practice/pythagorean-triplet/pythagorean_triplet_spec.moon @@ -1,6 +1,6 @@ import triplets_with_sum from require 'pythagorean_triplet' -describe 'pythagorean-triplet', -> +describe 'pythagorean-triplet:', -> it 'triplets whose sum is 12', -> result = triplets_with_sum 12 expected = {{3, 4, 5}} diff --git a/exercises/practice/queen-attack/queen_attack_spec.moon b/exercises/practice/queen-attack/queen_attack_spec.moon index ebc602b..0517d91 100644 --- a/exercises/practice/queen-attack/queen_attack_spec.moon +++ b/exercises/practice/queen-attack/queen_attack_spec.moon @@ -1,9 +1,9 @@ Queen = require 'queen_attack' -describe 'queen-attack', -> +describe 'queen-attack:', -> -- Valid values for rows and columns are: 0 to 7 inclusive. - describe 'Test creation of Queens with valid and invalid positions', -> + describe 'Test creation of Queens with valid and invalid positions:', -> it 'queen with a valid position', -> queen = Queen 2, 2 assert.is.truthy queen @@ -24,7 +24,7 @@ describe 'queen-attack', -> f = -> Queen 4, 8 assert.has.errors f, 'invalid position' - describe 'Test the ability of one queen to attack another', -> + describe 'Test the ability of one queen to attack another:', -> pending 'cannot attack', -> black_queen = Queen 6, 6 white_queen = Queen 2, 4 diff --git a/exercises/practice/rail-fence-cipher/rail_fence_cipher_spec.moon b/exercises/practice/rail-fence-cipher/rail_fence_cipher_spec.moon index 39e36c1..6d0e041 100644 --- a/exercises/practice/rail-fence-cipher/rail_fence_cipher_spec.moon +++ b/exercises/practice/rail-fence-cipher/rail_fence_cipher_spec.moon @@ -1,7 +1,7 @@ RailFenceCipher = require 'rail_fence_cipher' -describe 'rail-fence-cipher', -> - describe 'encode', -> +describe 'rail-fence-cipher:', -> + describe 'encode:', -> it 'encode with two rails', -> result = RailFenceCipher.encode 2, 'XOXOXOXOXOXOXOXOXO' expected = 'XXXXXXXXXOOOOOOOOO' @@ -17,7 +17,7 @@ describe 'rail-fence-cipher', -> expected = 'ESXIEECSR' assert.are.equal expected, result - describe 'decode', -> + describe 'decode:', -> pending 'decode with three rails', -> result = RailFenceCipher.decode 3, 'TEITELHDVLSNHDTISEIIEA' expected = 'THEDEVILISINTHEDETAILS' diff --git a/exercises/practice/raindrops/raindrops_spec.moon b/exercises/practice/raindrops/raindrops_spec.moon index 768a4f6..bfa31d7 100644 --- a/exercises/practice/raindrops/raindrops_spec.moon +++ b/exercises/practice/raindrops/raindrops_spec.moon @@ -1,6 +1,6 @@ raindrops = require 'raindrops' -describe 'raindrops', -> +describe 'raindrops:', -> it 'the sound for 1 is 1', -> result = raindrops 1 assert.are.equal '1', result diff --git a/exercises/practice/rational-numbers/rational_numbers_spec.moon b/exercises/practice/rational-numbers/rational_numbers_spec.moon index f3bf846..d45f231 100644 --- a/exercises/practice/rational-numbers/rational_numbers_spec.moon +++ b/exercises/practice/rational-numbers/rational_numbers_spec.moon @@ -1,6 +1,6 @@ rational = require 'rational_numbers' -describe 'rational-numbers', -> +describe 'rational-numbers:', -> -- ---------------------------------------- -- Why do we need to test "approximately equal"? -- See https://0.30000000000000004.com @@ -15,8 +15,8 @@ describe 'rational-numbers', -> assert\register 'assertion', 'approx_equal', is_close_to, 'assertion.approx_equal.positive', 'assertion.approx_equal.negative' -- ---------------------------------------- - describe 'Arithmetic', -> - describe 'Addition', -> + describe 'Arithmetic:', -> + describe 'Addition:', -> it 'Add two positive rational numbers', -> result = rational.add {1, 2}, {2, 3} expected = {7, 6} @@ -37,7 +37,7 @@ describe 'rational-numbers', -> expected = {0, 1} assert.are.same expected, result - describe 'Subtraction', -> + describe 'Subtraction:', -> pending 'Subtract two positive rational numbers', -> result = rational.sub {1, 2}, {2, 3} expected = {-1, 6} @@ -58,7 +58,7 @@ describe 'rational-numbers', -> expected = {0, 1} assert.are.same expected, result - describe 'Multiplication', -> + describe 'Multiplication:', -> pending 'Multiply two positive rational numbers', -> result = rational.mul {1, 2}, {2, 3} expected = {1, 3} @@ -89,7 +89,7 @@ describe 'rational-numbers', -> expected = {0, 1} assert.are.same expected, result - describe 'Division', -> + describe 'Division:', -> pending 'Divide two positive rational numbers', -> result = rational.div {1, 2}, {2, 3} expected = {3, 4} @@ -110,7 +110,7 @@ describe 'rational-numbers', -> expected = {1, 2} assert.are.same expected, result - describe 'Absolute value', -> + describe 'Absolute value:', -> pending 'Absolute value of a positive rational number', -> result = rational.abs {1, 2} assert.are.same {1, 2}, result @@ -135,7 +135,7 @@ describe 'rational-numbers', -> result = rational.abs {2, 4} assert.are.same {1, 2}, result - describe 'Exponentiation of a rational number', -> + describe 'Exponentiation of a rational number:', -> pending 'Raise a positive rational number to a positive integer power', -> result = rational.exprational {1, 2}, 3 assert.are.same {1, 8}, result @@ -172,7 +172,7 @@ describe 'rational-numbers', -> result = rational.exprational {-1, 2}, 0 assert.are.same {1, 1}, result - describe 'Exponentiation of a real number to a rational number', -> + describe 'Exponentiation of a real number to a rational number:', -> pending 'Raise a real number to a positive rational number', -> result = rational.expreal 8, {4, 3} assert.approx_equal 16.0, result @@ -185,7 +185,7 @@ describe 'rational-numbers', -> result = rational.expreal 2, {0, 1} assert.approx_equal 1.0, result - describe 'Reduction to lowest terms', -> + describe 'Reduction to lowest terms:', -> pending 'Reduce a positive rational number to lowest terms', -> result = rational.reduce {2, 4} assert.are.same {1, 2}, result diff --git a/exercises/practice/react/.meta/spec_generator.moon b/exercises/practice/react/.meta/spec_generator.moon new file mode 100644 index 0000000..d477f33 --- /dev/null +++ b/exercises/practice/react/.meta/spec_generator.moon @@ -0,0 +1 @@ +error 'react does not use a generator. Please update spec by hand.' diff --git a/exercises/practice/rectangles/rectangles_spec.moon b/exercises/practice/rectangles/rectangles_spec.moon index 693d61d..8f3633d 100644 --- a/exercises/practice/rectangles/rectangles_spec.moon +++ b/exercises/practice/rectangles/rectangles_spec.moon @@ -1,6 +1,6 @@ import rectangles from require 'rectangles' -describe 'rectangles', -> +describe 'rectangles:', -> it 'no rows', -> input = {} assert.are.equal 0, rectangles input diff --git a/exercises/practice/resistor-color-duo/resistor_color_duo_spec.moon b/exercises/practice/resistor-color-duo/resistor_color_duo_spec.moon index 1654de6..faa7a36 100644 --- a/exercises/practice/resistor-color-duo/resistor_color_duo_spec.moon +++ b/exercises/practice/resistor-color-duo/resistor_color_duo_spec.moon @@ -1,6 +1,6 @@ ResistorColorDuo = require 'resistor_color_duo' -describe 'resistor-color-duo', -> +describe 'resistor-color-duo:', -> it 'Brown and black', -> result = ResistorColorDuo.value 'brown', 'black' assert.are.equal 10, result diff --git a/exercises/practice/resistor-color-trio/resistor_color_trio_spec.moon b/exercises/practice/resistor-color-trio/resistor_color_trio_spec.moon index 9090afe..8f68f61 100644 --- a/exercises/practice/resistor-color-trio/resistor_color_trio_spec.moon +++ b/exercises/practice/resistor-color-trio/resistor_color_trio_spec.moon @@ -1,6 +1,6 @@ ResistorColorTrio = require 'resistor_color_trio' -describe 'resistor-color-trio', -> +describe 'resistor-color-trio:', -> it 'Orange and orange and black', -> result = ResistorColorTrio.label 'orange', 'orange', 'black' assert.are.equal '33 ohms', result diff --git a/exercises/practice/resistor-color/resistor_color_spec.moon b/exercises/practice/resistor-color/resistor_color_spec.moon index 4a09d69..36cce26 100644 --- a/exercises/practice/resistor-color/resistor_color_spec.moon +++ b/exercises/practice/resistor-color/resistor_color_spec.moon @@ -1,7 +1,7 @@ ResistorColor = require 'resistor_color' -describe 'resistor-color', -> - describe 'Color codes', -> +describe 'resistor-color:', -> + describe 'Color codes:', -> it 'Black', -> result = ResistorColor.color_code 'black' assert.are.equal 0, result diff --git a/exercises/practice/rest-api/rest_api_spec.moon b/exercises/practice/rest-api/rest_api_spec.moon index f2e42e2..e6eed4f 100644 --- a/exercises/practice/rest-api/rest_api_spec.moon +++ b/exercises/practice/rest-api/rest_api_spec.moon @@ -1,9 +1,9 @@ RestApi = require 'rest_api' -describe 'rest-api', -> +describe 'rest-api:', -> assert\set_parameter "TableFormatLevel", 4 - describe 'user management', -> + describe 'user management:', -> it 'no users', -> database = { users: {} @@ -25,9 +25,9 @@ describe 'rest-api', -> } result = api\POST '/add', payload expected = { - owed_by: {} balance: 0.0 owes: {} + owed_by: {} name: "Adam" } assert.are.same expected, result @@ -35,14 +35,14 @@ describe 'rest-api', -> pending 'get single user', -> database = { users: {{ - owed_by: {} balance: 0.0 owes: {} + owed_by: {} name: "Adam" }, { - owed_by: {} balance: 0.0 owes: {} + owed_by: {} name: "Bob" }} } @@ -53,50 +53,50 @@ describe 'rest-api', -> result = api\GET '/users', payload expected = { users: {{ - owed_by: {} balance: 0.0 owes: {} + owed_by: {} name: "Bob" }} } assert.are.same expected, result - describe 'iou', -> + describe 'iou:', -> pending 'both users have 0 balance', -> database = { users: {{ - owed_by: {} balance: 0.0 owes: {} + owed_by: {} name: "Adam" }, { - owed_by: {} balance: 0.0 owes: {} + owed_by: {} name: "Bob" }} } api = RestApi database payload = { + amount: 3.0 borrower: "Bob" lender: "Adam" - amount: 3.0 } result = api\POST '/iou', payload expected = { users: {{ + balance: 3.0 + owes: {} owed_by: { Bob: 3.0 } - balance: 3.0 - owes: {} name: "Adam" }, { - owed_by: {} balance: -3.0 owes: { Adam: 3.0 } + owed_by: {} name: "Bob" }} } @@ -105,48 +105,48 @@ describe 'rest-api', -> pending 'borrower has negative balance', -> database = { users: {{ - owed_by: {} balance: 0.0 owes: {} + owed_by: {} name: "Adam" }, { - owed_by: {} balance: -3.0 owes: { Chuck: 3.0 } + owed_by: {} name: "Bob" }, { + balance: 3.0 + owes: {} owed_by: { Bob: 3.0 } - balance: 3.0 - owes: {} name: "Chuck" }} } api = RestApi database payload = { + amount: 3.0 borrower: "Bob" lender: "Adam" - amount: 3.0 } result = api\POST '/iou', payload expected = { users: {{ + balance: 3.0 + owes: {} owed_by: { Bob: 3.0 } - balance: 3.0 - owes: {} name: "Adam" }, { - owed_by: {} balance: -6.0 owes: { Chuck: 3.0 Adam: 3.0 } + owed_by: {} name: "Bob" }} } @@ -155,49 +155,49 @@ describe 'rest-api', -> pending 'lender has negative balance', -> database = { users: {{ - owed_by: {} balance: 0.0 owes: {} + owed_by: {} name: "Adam" }, { - owed_by: {} balance: -3.0 owes: { Chuck: 3.0 } + owed_by: {} name: "Bob" }, { + balance: 3.0 + owes: {} owed_by: { Bob: 3.0 } - balance: 3.0 - owes: {} name: "Chuck" }} } api = RestApi database payload = { + amount: 3.0 borrower: "Adam" lender: "Bob" - amount: 3.0 } result = api\POST '/iou', payload expected = { users: {{ - owed_by: {} balance: -3.0 owes: { Bob: 3.0 } + owed_by: {} name: "Adam" }, { - owed_by: { - Adam: 3.0 - } balance: 0.0 owes: { Chuck: 3.0 } + owed_by: { + Adam: 3.0 + } name: "Bob" }} } @@ -206,42 +206,42 @@ describe 'rest-api', -> pending 'lender owes borrower', -> database = { users: {{ - owed_by: {} balance: -3.0 owes: { Bob: 3.0 } + owed_by: {} name: "Adam" }, { + balance: 3.0 + owes: {} owed_by: { Adam: 3.0 } - balance: 3.0 - owes: {} name: "Bob" }} } api = RestApi database payload = { + amount: 2.0 borrower: "Bob" lender: "Adam" - amount: 2.0 } result = api\POST '/iou', payload expected = { users: {{ - owed_by: {} balance: -1.0 owes: { Bob: 1.0 } + owed_by: {} name: "Adam" }, { + balance: 1.0 + owes: {} owed_by: { Adam: 1.0 } - balance: 1.0 - owes: {} name: "Bob" }} } @@ -250,42 +250,42 @@ describe 'rest-api', -> pending 'lender owes borrower less than new loan', -> database = { users: {{ - owed_by: {} balance: -3.0 owes: { Bob: 3.0 } + owed_by: {} name: "Adam" }, { + balance: 3.0 + owes: {} owed_by: { Adam: 3.0 } - balance: 3.0 - owes: {} name: "Bob" }} } api = RestApi database payload = { + amount: 4.0 borrower: "Bob" lender: "Adam" - amount: 4.0 } result = api\POST '/iou', payload expected = { users: {{ + balance: 1.0 + owes: {} owed_by: { Bob: 1.0 } - balance: 1.0 - owes: {} name: "Adam" }, { - owed_by: {} balance: -1.0 owes: { Adam: 1.0 } + owed_by: {} name: "Bob" }} } @@ -294,38 +294,38 @@ describe 'rest-api', -> pending 'lender owes borrower same as new loan', -> database = { users: {{ - owed_by: {} balance: -3.0 owes: { Bob: 3.0 } + owed_by: {} name: "Adam" }, { + balance: 3.0 + owes: {} owed_by: { Adam: 3.0 } - balance: 3.0 - owes: {} name: "Bob" }} } api = RestApi database payload = { + amount: 3.0 borrower: "Bob" lender: "Adam" - amount: 3.0 } result = api\POST '/iou', payload expected = { users: {{ - owed_by: {} balance: 0.0 owes: {} + owed_by: {} name: "Adam" }, { - owed_by: {} balance: 0.0 owes: {} + owed_by: {} name: "Bob" }} } diff --git a/exercises/practice/reverse-string/reverse_string_spec.moon b/exercises/practice/reverse-string/reverse_string_spec.moon index eeab849..251d046 100644 --- a/exercises/practice/reverse-string/reverse_string_spec.moon +++ b/exercises/practice/reverse-string/reverse_string_spec.moon @@ -1,6 +1,6 @@ reverse = require 'reverse_string' -describe 'reverse-string', -> +describe 'reverse-string:', -> it 'an empty string', -> result = reverse '' assert.are.equal '', result diff --git a/exercises/practice/rna-transcription/rna_transcription_spec.moon b/exercises/practice/rna-transcription/rna_transcription_spec.moon index 7025224..6e67741 100644 --- a/exercises/practice/rna-transcription/rna_transcription_spec.moon +++ b/exercises/practice/rna-transcription/rna_transcription_spec.moon @@ -1,6 +1,6 @@ to_rna = require 'rna_transcription' -describe 'rna-transcription', -> +describe 'rna-transcription:', -> it 'Empty RNA sequence', -> result = to_rna '' assert.are.equal '', result diff --git a/exercises/practice/robot-name/.meta/spec_generator.moon b/exercises/practice/robot-name/.meta/spec_generator.moon new file mode 100644 index 0000000..ee2d191 --- /dev/null +++ b/exercises/practice/robot-name/.meta/spec_generator.moon @@ -0,0 +1 @@ +error 'robot-name does not use a generator. Please update spec by hand.' diff --git a/exercises/practice/robot-simulator/robot_simulator_spec.moon b/exercises/practice/robot-simulator/robot_simulator_spec.moon index b748c8a..5213d85 100644 --- a/exercises/practice/robot-simulator/robot_simulator_spec.moon +++ b/exercises/practice/robot-simulator/robot_simulator_spec.moon @@ -1,7 +1,7 @@ Robot = require 'robot_simulator' -describe 'robot-simulator', -> - describe 'Create robot', -> +describe 'robot-simulator:', -> + describe 'Create robot:', -> it 'at origin facing north', -> robot = Robot x: 0, y: 0, direction: 'north' assert.are.equal 0, robot\x! @@ -14,7 +14,7 @@ describe 'robot-simulator', -> assert.are.equal -1, robot\y! assert.are.equal 'south', robot\direction! - describe 'Rotating clockwise', -> + describe 'Rotating clockwise:', -> pending 'changes north to east', -> robot = Robot x: 0, y: 0, direction: 'north' robot\move 'R' @@ -43,7 +43,7 @@ describe 'robot-simulator', -> assert.are.equal 0, robot\y! assert.are.equal 'north', robot\direction! - describe 'Rotating counter-clockwise', -> + describe 'Rotating counter-clockwise:', -> pending 'changes north to west', -> robot = Robot x: 0, y: 0, direction: 'north' robot\move 'L' @@ -72,7 +72,7 @@ describe 'robot-simulator', -> assert.are.equal 0, robot\y! assert.are.equal 'north', robot\direction! - describe 'Moving forward one', -> + describe 'Moving forward one:', -> pending 'facing north increments Y', -> robot = Robot x: 0, y: 0, direction: 'north' robot\move 'A' @@ -101,7 +101,7 @@ describe 'robot-simulator', -> assert.are.equal 0, robot\y! assert.are.equal 'west', robot\direction! - describe 'Follow series of instructions', -> + describe 'Follow series of instructions:', -> pending 'moving east and north from README', -> robot = Robot x: 7, y: 3, direction: 'north' robot\move 'RAALAL' diff --git a/exercises/practice/roman-numerals/roman_numerals_spec.moon b/exercises/practice/roman-numerals/roman_numerals_spec.moon index 31410ca..5ddf819 100644 --- a/exercises/practice/roman-numerals/roman_numerals_spec.moon +++ b/exercises/practice/roman-numerals/roman_numerals_spec.moon @@ -1,6 +1,6 @@ RomanNumerals = require 'roman_numerals' -describe 'roman-numerals', -> +describe 'roman-numerals:', -> it '1 is I', -> assert.are.equal 'I', RomanNumerals.to_roman 1 diff --git a/exercises/practice/rotational-cipher/rotational_cipher_spec.moon b/exercises/practice/rotational-cipher/rotational_cipher_spec.moon index f673f9d..a3c6495 100644 --- a/exercises/practice/rotational-cipher/rotational_cipher_spec.moon +++ b/exercises/practice/rotational-cipher/rotational_cipher_spec.moon @@ -1,6 +1,6 @@ RotationalCipher = require 'rotational_cipher' -describe 'rotational-cipher', -> +describe 'rotational-cipher:', -> it 'rotate a by 0, same output as input', -> result = RotationalCipher.rotate 'a', 0 expected = 'a' diff --git a/exercises/practice/run-length-encoding/run_length_encoding_spec.moon b/exercises/practice/run-length-encoding/run_length_encoding_spec.moon index 2ba0cef..6e8feae 100644 --- a/exercises/practice/run-length-encoding/run_length_encoding_spec.moon +++ b/exercises/practice/run-length-encoding/run_length_encoding_spec.moon @@ -1,7 +1,7 @@ import encode, decode from require 'run_length_encoding' -describe 'run-length-encoding', -> - describe 'run-length encode a string', -> +describe 'run-length-encoding:', -> + describe 'run-length encode a string:', -> it 'empty string', -> result = encode '' assert.are.equal '', result @@ -26,7 +26,7 @@ describe 'run-length-encoding', -> result = encode 'aabbbcccc' assert.are.equal '2a3b4c', result - describe 'run-length decode a string', -> + describe 'run-length decode a string:', -> pending 'empty string', -> result = decode '' assert.are.equal '', result @@ -51,7 +51,7 @@ describe 'run-length-encoding', -> result = decode '2a3b4c' assert.are.equal 'aabbbcccc', result - describe 'encode and then decode', -> + describe 'encode and then decode:', -> pending 'encode followed by decode gives original string', -> encoded = encode 'zzz ZZ zZ' decoded = decode encoded diff --git a/exercises/practice/saddle-points/saddle_points_spec.moon b/exercises/practice/saddle-points/saddle_points_spec.moon index 5f54f10..5b9d907 100644 --- a/exercises/practice/saddle-points/saddle_points_spec.moon +++ b/exercises/practice/saddle-points/saddle_points_spec.moon @@ -1,6 +1,6 @@ import saddle_points from require 'saddle_points' -describe 'saddle-points', -> +describe 'saddle-points:', -> cmp_saddle_points = (a, b) -> a.row < b.row or (a.row == b.row and a.column < b.column) diff --git a/exercises/practice/satellite/.meta/spec_generator.moon b/exercises/practice/satellite/.meta/spec_generator.moon new file mode 100644 index 0000000..3e675ed --- /dev/null +++ b/exercises/practice/satellite/.meta/spec_generator.moon @@ -0,0 +1 @@ +error 'satellite does not use a generator. Please update spec by hand.' diff --git a/exercises/practice/say/say_spec.moon b/exercises/practice/say/say_spec.moon index 2a2fdbb..cb3c033 100644 --- a/exercises/practice/say/say_spec.moon +++ b/exercises/practice/say/say_spec.moon @@ -1,6 +1,6 @@ Say = require './say' -describe 'say', -> +describe 'say:', -> it 'zero', -> result = Say.in_english 0 expected = 'zero' diff --git a/exercises/practice/scrabble-score/scrabble_score_spec.moon b/exercises/practice/scrabble-score/scrabble_score_spec.moon index c704f46..4a8dc69 100644 --- a/exercises/practice/scrabble-score/scrabble_score_spec.moon +++ b/exercises/practice/scrabble-score/scrabble_score_spec.moon @@ -1,6 +1,6 @@ Scrabble = require 'scrabble_score' -describe 'scrabble-score', -> +describe 'scrabble-score:', -> it 'lowercase letter', -> result = Scrabble.score 'a' assert.are.equal 1, result diff --git a/exercises/practice/secret-handshake/secret_handshake_spec.moon b/exercises/practice/secret-handshake/secret_handshake_spec.moon index 9bd6d3b..eca5950 100644 --- a/exercises/practice/secret-handshake/secret_handshake_spec.moon +++ b/exercises/practice/secret-handshake/secret_handshake_spec.moon @@ -1,6 +1,6 @@ SecretHandshake = require 'secret_handshake' -describe 'secret-handshake', -> +describe 'secret-handshake:', -> it 'wink for 1', -> result = SecretHandshake.commands 1 expected = {'wink'} diff --git a/exercises/practice/series/series_spec.moon b/exercises/practice/series/series_spec.moon index 4669571..c91c7ca 100644 --- a/exercises/practice/series/series_spec.moon +++ b/exercises/practice/series/series_spec.moon @@ -1,6 +1,6 @@ import slices from require 'series' -describe 'series', -> +describe 'series:', -> it 'slices of one from one', -> result = [slice for slice in slices '1', 1] expected = {'1'} diff --git a/exercises/practice/sgf-parsing/sgf_parsing_spec.moon b/exercises/practice/sgf-parsing/sgf_parsing_spec.moon index 0f9b4a6..5f7f00c 100644 --- a/exercises/practice/sgf-parsing/sgf_parsing_spec.moon +++ b/exercises/practice/sgf-parsing/sgf_parsing_spec.moon @@ -1,6 +1,6 @@ SGFParser = require 'sgf_parsing' -describe 'sgf-parsing', -> +describe 'sgf-parsing:', -> assert\set_parameter "TableFormatLevel", 5 it 'empty input', -> @@ -38,8 +38,8 @@ describe 'sgf-parsing', -> expected = { children: {} properties: { - C: {"d"} A: {"b"} + C: {"d"} } } assert.are.same expected, result @@ -151,8 +151,8 @@ describe 'sgf-parsing', -> } }} properties: { - B: {"bar"} A: {"x[y]z", "foo"} + B: {"bar"} } } assert.are.same expected, result @@ -167,8 +167,8 @@ describe 'sgf-parsing', -> } }} properties: { - B: {"bar"} A: {"a;b", "foo"} + B: {"bar"} } } assert.are.same expected, result @@ -183,8 +183,8 @@ describe 'sgf-parsing', -> } }} properties: { - B: {"bar"} A: {"x(y)z", "foo"} + B: {"bar"} } } assert.are.same expected, result diff --git a/exercises/practice/sieve/sieve_spec.moon b/exercises/practice/sieve/sieve_spec.moon index fe144a7..f44113d 100644 --- a/exercises/practice/sieve/sieve_spec.moon +++ b/exercises/practice/sieve/sieve_spec.moon @@ -1,6 +1,6 @@ Sieve = require 'sieve' -describe 'sieve', -> +describe 'sieve:', -> it 'no primes under two', -> result = Sieve.primes 1 expected = {} diff --git a/exercises/practice/simple-cipher/simple_cipher_spec.moon b/exercises/practice/simple-cipher/simple_cipher_spec.moon index 537c06b..3cb0467 100644 --- a/exercises/practice/simple-cipher/simple_cipher_spec.moon +++ b/exercises/practice/simple-cipher/simple_cipher_spec.moon @@ -1,7 +1,7 @@ SimpleCipher = require 'simple_cipher' -describe 'simple-cipher', -> - describe 'Random key cipher', -> +describe 'simple-cipher:', -> + describe 'Random key cipher:', -> it 'Can encode', -> cipher = SimpleCipher! plaintext = 'aaaaaaaaaa' @@ -28,7 +28,7 @@ describe 'simple-cipher', -> key = cipher\key! assert.is.truthy key\match('^[a-z]+$') - describe 'Substitution cipher', -> + describe 'Substitution cipher:', -> pending 'Can encode', -> cipher = SimpleCipher 'abcdefghij' result = cipher\encode 'aaaaaaaaaa' diff --git a/exercises/practice/simple-linked-list/simple_linked_list_spec.moon b/exercises/practice/simple-linked-list/simple_linked_list_spec.moon index 8df7a75..a1e6474 100644 --- a/exercises/practice/simple-linked-list/simple_linked_list_spec.moon +++ b/exercises/practice/simple-linked-list/simple_linked_list_spec.moon @@ -1,7 +1,7 @@ SimpleLinkedList = require 'simple_linked_list' -describe 'simple-linked-list', -> - describe 'count', -> +describe 'simple-linked-list:', -> + describe 'count:', -> it 'Empty list has length of zero', -> list = SimpleLinkedList {} result = list\count! @@ -17,7 +17,7 @@ describe 'simple-linked-list', -> result = list\count! assert.are.equal 3, result - describe 'pop', -> + describe 'pop:', -> pending 'Pop from empty list is an error', -> list = SimpleLinkedList {} f = -> list\pop! @@ -53,7 +53,7 @@ describe 'simple-linked-list', -> result = list\count! assert.are.equal 0, result - describe 'push', -> + describe 'push:', -> pending 'Can push to an empty list', -> list = SimpleLinkedList! list\push 1 @@ -84,7 +84,7 @@ describe 'simple-linked-list', -> result = list\count! assert.are.equal 0, result - describe 'peek', -> + describe 'peek:', -> pending 'Peek on empty list is an error', -> list = SimpleLinkedList {} f = -> list\peek! @@ -122,7 +122,7 @@ describe 'simple-linked-list', -> assert.are.equal 3, result - describe 'toList FIFO', -> + describe 'toList FIFO:', -> pending 'Empty linked list to list is empty', -> list = SimpleLinkedList {} result = list\toList! @@ -144,7 +144,7 @@ describe 'simple-linked-list', -> result = list\toList! assert.are.same {1, 2, 4}, result - describe 'reverse', -> + describe 'reverse:', -> pending 'Reversed empty list has same values', -> list = SimpleLinkedList {} list\reverse! diff --git a/exercises/practice/space-age/space_age_spec.moon b/exercises/practice/space-age/space_age_spec.moon index 5dea730..ffeb300 100644 --- a/exercises/practice/space-age/space_age_spec.moon +++ b/exercises/practice/space-age/space_age_spec.moon @@ -1,6 +1,6 @@ SpaceAge = require 'space_age' -describe 'space-age', -> +describe 'space-age:', -> -- ---------------------------------------- -- Why do we need to test "approximately equal"? -- See https://0.30000000000000004.com diff --git a/exercises/practice/spiral-matrix/spiral_matrix_spec.moon b/exercises/practice/spiral-matrix/spiral_matrix_spec.moon index 072bdcd..4f80844 100644 --- a/exercises/practice/spiral-matrix/spiral_matrix_spec.moon +++ b/exercises/practice/spiral-matrix/spiral_matrix_spec.moon @@ -1,6 +1,6 @@ import spiral_matrix from require 'spiral_matrix' -describe 'spiral-matrix', -> +describe 'spiral-matrix:', -> it 'empty spiral', -> result = spiral_matrix 0 expected = {} diff --git a/exercises/practice/split-second-stopwatch/split_second_stopwatch_spec.moon b/exercises/practice/split-second-stopwatch/split_second_stopwatch_spec.moon index af2b53a..fb7f3b5 100644 --- a/exercises/practice/split-second-stopwatch/split_second_stopwatch_spec.moon +++ b/exercises/practice/split-second-stopwatch/split_second_stopwatch_spec.moon @@ -1,6 +1,6 @@ SplitSecondStopwatch = require 'split_second_stopwatch' -describe 'split-second-stopwatch', -> +describe 'split-second-stopwatch:', -> it 'new stopwatch starts in ready state', -> stopwatch = SplitSecondStopwatch.Stopwatch! assert.same 'ready', stopwatch\state! diff --git a/exercises/practice/square-root/square_root_spec.moon b/exercises/practice/square-root/square_root_spec.moon index f99a5a5..07aaceb 100644 --- a/exercises/practice/square-root/square_root_spec.moon +++ b/exercises/practice/square-root/square_root_spec.moon @@ -1,6 +1,6 @@ SquareRoot = require 'square_root' -describe 'square-root', -> +describe 'square-root:', -> it 'root of 1', -> result = SquareRoot.sqrt 1 assert.are.equal 1, result diff --git a/exercises/practice/state-of-tic-tac-toe/state_of_tic_tac_toe_spec.moon b/exercises/practice/state-of-tic-tac-toe/state_of_tic_tac_toe_spec.moon index 971b9a6..41e3899 100644 --- a/exercises/practice/state-of-tic-tac-toe/state_of_tic_tac_toe_spec.moon +++ b/exercises/practice/state-of-tic-tac-toe/state_of_tic_tac_toe_spec.moon @@ -1,7 +1,7 @@ import gamestate from require 'state_of_tic_tac_toe' -describe 'state-of-tic-tac-toe', -> - describe 'Won games', -> +describe 'state-of-tic-tac-toe:', -> + describe 'Won games:', -> it 'Finished game where X won via left column victory', -> board = { 'XOO', @@ -146,7 +146,7 @@ describe 'state-of-tic-tac-toe', -> } assert.are.equal 'win', gamestate board - describe 'Drawn games', -> + describe 'Drawn games:', -> pending 'Draw', -> board = { 'XOX', @@ -163,7 +163,7 @@ describe 'state-of-tic-tac-toe', -> } assert.are.equal 'draw', gamestate board - describe 'Ongoing games', -> + describe 'Ongoing games:', -> pending 'Ongoing game: one move in', -> board = { ' ', @@ -188,7 +188,7 @@ describe 'state-of-tic-tac-toe', -> } assert.are.equal 'ongoing', gamestate board - describe 'Invalid boards', -> + describe 'Invalid boards:', -> pending 'Invalid board: X went twice', -> board = { 'XX ', diff --git a/exercises/practice/strain/strain_spec.moon b/exercises/practice/strain/strain_spec.moon index c050ff8..16b5f63 100644 --- a/exercises/practice/strain/strain_spec.moon +++ b/exercises/practice/strain/strain_spec.moon @@ -1,6 +1,6 @@ Strain = require 'strain' -describe 'strain', -> +describe 'strain:', -> starts_with = (str, prefix) -> str\sub(1, #prefix) == prefix diff --git a/exercises/practice/sum-of-multiples/sum_of_multiples_spec.moon b/exercises/practice/sum-of-multiples/sum_of_multiples_spec.moon index 53bd629..246e659 100644 --- a/exercises/practice/sum-of-multiples/sum_of_multiples_spec.moon +++ b/exercises/practice/sum-of-multiples/sum_of_multiples_spec.moon @@ -1,6 +1,6 @@ SumOfMultiples = require 'sum_of_multiples' -describe 'sum-of-multiples', -> +describe 'sum-of-multiples:', -> it 'no multiples within limit', -> result = SumOfMultiples.sum {3, 5}, 1 assert.are.equal 0, result diff --git a/exercises/practice/swift-scheduling/swift_scheduling_spec.moon b/exercises/practice/swift-scheduling/swift_scheduling_spec.moon index d177a78..f3b0ec9 100644 --- a/exercises/practice/swift-scheduling/swift_scheduling_spec.moon +++ b/exercises/practice/swift-scheduling/swift_scheduling_spec.moon @@ -1,6 +1,6 @@ import delivery_date from require 'swift_scheduling' -describe 'swift-scheduling', -> +describe 'swift-scheduling:', -> it 'NOW translates to two hours later', -> result = delivery_date 'NOW', '2012-02-13T09:00:00' expected = '2012-02-13T11:00:00' diff --git a/exercises/practice/tournament/tournament_spec.moon b/exercises/practice/tournament/tournament_spec.moon index 06eb864..9d9f936 100644 --- a/exercises/practice/tournament/tournament_spec.moon +++ b/exercises/practice/tournament/tournament_spec.moon @@ -1,6 +1,6 @@ tournament = require 'tournament' -describe 'tournament', -> +describe 'tournament:', -> write_file = (filename, lines) -> with io.open filename, 'w' diff --git a/exercises/practice/transpose/transpose_spec.moon b/exercises/practice/transpose/transpose_spec.moon index 7f78d1f..904f62c 100644 --- a/exercises/practice/transpose/transpose_spec.moon +++ b/exercises/practice/transpose/transpose_spec.moon @@ -1,6 +1,6 @@ import transpose from require 'transpose' -describe 'transpose', -> +describe 'transpose:', -> it 'empty string', -> input = {} expected = {} diff --git a/exercises/practice/triangle/triangle_spec.moon b/exercises/practice/triangle/triangle_spec.moon index a056579..989255e 100644 --- a/exercises/practice/triangle/triangle_spec.moon +++ b/exercises/practice/triangle/triangle_spec.moon @@ -1,7 +1,7 @@ import is_equilateral, is_isosceles, is_scalene from require 'triangle' -describe 'triangle', -> - describe 'equilateral triangle', -> +describe 'triangle:', -> + describe 'equilateral triangle:', -> it 'all sides are equal', -> assert.is_true is_equilateral(2, 2, 2) @@ -17,7 +17,7 @@ describe 'triangle', -> pending 'sides may be floats', -> assert.is_true is_equilateral(0.5, 0.5, 0.5) - describe 'isosceles triangle', -> + describe 'isosceles triangle:', -> pending 'last two sides are equal', -> assert.is_true is_isosceles(3, 4, 4) @@ -45,7 +45,7 @@ describe 'triangle', -> pending 'sides may be floats', -> assert.is_true is_isosceles(0.5, 0.4, 0.5) - describe 'scalene triangle', -> + describe 'scalene triangle:', -> pending 'no sides are equal', -> assert.is_true is_scalene(5, 4, 6) diff --git a/exercises/practice/twelve-days/twelve_days_spec.moon b/exercises/practice/twelve-days/twelve_days_spec.moon index 9bf188c..ffbb41b 100644 --- a/exercises/practice/twelve-days/twelve_days_spec.moon +++ b/exercises/practice/twelve-days/twelve_days_spec.moon @@ -1,7 +1,7 @@ TwelveDays = require 'twelve_days' -describe 'twelve-days', -> - describe 'verse', -> +describe 'twelve-days:', -> + describe 'verse:', -> it 'first day a partridge in a pear tree', -> result = TwelveDays.recite 1, 1 expected = {'On the first day of Christmas my true love gave to me: a Partridge in a Pear Tree.'} @@ -62,7 +62,7 @@ describe 'twelve-days', -> expected = {'On the twelfth day of Christmas my true love gave to me: twelve Drummers Drumming, eleven Pipers Piping, ten Lords-a-Leaping, nine Ladies Dancing, eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.'} assert.are.same expected, result - describe 'lyrics', -> + describe 'lyrics:', -> pending 'recites first three verses of the song', -> result = TwelveDays.recite 1, 3 expected = { diff --git a/exercises/practice/two-bucket/two_bucket_spec.moon b/exercises/practice/two-bucket/two_bucket_spec.moon index b22d73c..6842795 100644 --- a/exercises/practice/two-bucket/two_bucket_spec.moon +++ b/exercises/practice/two-bucket/two_bucket_spec.moon @@ -1,6 +1,6 @@ import measure from require 'two_bucket' -describe 'two-bucket', -> +describe 'two-bucket:', -> it 'Measure using bucket one of size 3 and bucket two of size 5 - start with bucket one', -> result = measure bucketOne: 3, bucketTwo: 5, goal: 1, startBucket: 'one' expected = moves: 4, goalBucket: 'one', otherBucket: 5 diff --git a/exercises/practice/two-fer/.meta/spec_generator.moon b/exercises/practice/two-fer/.meta/spec_generator.moon new file mode 100644 index 0000000..17602f6 --- /dev/null +++ b/exercises/practice/two-fer/.meta/spec_generator.moon @@ -0,0 +1 @@ +error 'two-fer does not use a generator. Please update spec by hand.' diff --git a/exercises/practice/variable-length-quantity/variable_length_quantity_spec.moon b/exercises/practice/variable-length-quantity/variable_length_quantity_spec.moon index 7628e89..d591426 100644 --- a/exercises/practice/variable-length-quantity/variable_length_quantity_spec.moon +++ b/exercises/practice/variable-length-quantity/variable_length_quantity_spec.moon @@ -1,7 +1,7 @@ VariableLengthQuantity = require 'variable_length_quantity' -describe 'variable-length-quantity', -> - describe 'Encode a series of integers, producing a series of bytes.', -> +describe 'variable-length-quantity:', -> + describe 'Encode a series of integers, producing a series of bytes.:', -> it 'zero', -> result = VariableLengthQuantity.encode {0} expected = {0} @@ -117,7 +117,7 @@ describe 'variable-length-quantity', -> expected = {192, 0, 200, 232, 86, 255, 255, 255, 127, 0, 255, 127, 129, 128, 0} assert.are.same expected, result - describe 'Decode a series of bytes, producing a series of integers.', -> + describe 'Decode a series of bytes, producing a series of integers.:', -> pending 'one byte', -> result = VariableLengthQuantity.decode {127} expected = {127} diff --git a/exercises/practice/word-count/word_count_spec.moon b/exercises/practice/word-count/word_count_spec.moon index 3b514f7..8dcda0f 100644 --- a/exercises/practice/word-count/word_count_spec.moon +++ b/exercises/practice/word-count/word_count_spec.moon @@ -1,6 +1,6 @@ import count_words from require 'word_count' -describe 'word-count', -> +describe 'word-count:', -> -- ---------------------------------------------------------- same_kv = (state, arguments) -> actual = arguments[1] @@ -28,20 +28,20 @@ describe 'word-count', -> pending 'count one of each word', -> result = count_words "one of each" expected = { - of: 1, - each: 1, one: 1, + each: 1, + of: 1, } assert.has.same_kv result, expected pending 'multiple occurrences of a word', -> result = count_words "one fish two fish red fish blue fish" expected = { - two: 1, blue: 1, - fish: 4, one: 1, red: 1, + fish: 4, + two: 1, } assert.has.same_kv result, expected @@ -49,8 +49,8 @@ describe 'word-count', -> result = count_words "one,two,three" expected = { two: 1, - one: 1, three: 1, + one: 1, } assert.has.same_kv result, expected @@ -58,8 +58,8 @@ describe 'word-count', -> result = count_words "one,\ntwo,\nthree" expected = { two: 1, - one: 1, three: 1, + one: 1, } assert.has.same_kv result, expected @@ -67,9 +67,9 @@ describe 'word-count', -> result = count_words "car: carpet as java: javascript!!&@$%^&" expected = { java: 1, + carpet: 1, javascript: 1, car: 1, - carpet: 1, as: 1, } assert.has.same_kv result, expected @@ -77,8 +77,8 @@ describe 'word-count', -> pending 'include numbers', -> result = count_words "testing, 1, 2 testing" expected = { - '2': 1, testing: 2, + '2': 1, '1': 1, } assert.has.same_kv result, expected @@ -86,33 +86,33 @@ describe 'word-count', -> pending 'normalize case', -> result = count_words "go Go GO Stop stop" expected = { - go: 3, stop: 2, + go: 3, } assert.has.same_kv result, expected pending 'with apostrophes', -> result = count_words "'First: don't laugh. Then: don't cry. You're getting it.'" expected = { - then: 1, - it: 1, + laugh: 1, getting: 1, + it: 1, + first: 1, "you're": 1, + then: 1, "don't": 2, - first: 1, cry: 1, - laugh: 1, } assert.has.same_kv result, expected pending 'with quotations', -> result = count_words "Joe can't tell between 'large' and large." expected = { - tell: 1, + and: 1, "can't": 1, - large: 2, joe: 1, - and: 1, + tell: 1, + large: 2, between: 1, } assert.has.same_kv result, expected @@ -120,14 +120,14 @@ describe 'word-count', -> pending 'substrings from the beginning', -> result = count_words "Joe can't tell between app, apple and a." expected = { - tell: 1, + and: 1, "can't": 1, a: 1, + apple: 1, app: 1, - between: 1, + tell: 1, joe: 1, - and: 1, - apple: 1, + between: 1, } assert.has.same_kv result, expected @@ -143,8 +143,8 @@ describe 'word-count', -> result = count_words ",\n,one,\n ,two \n 'three'" expected = { two: 1, - one: 1, three: 1, + one: 1, } assert.has.same_kv result, expected diff --git a/exercises/practice/wordy/wordy_spec.moon b/exercises/practice/wordy/wordy_spec.moon index 9b64673..ca7604f 100644 --- a/exercises/practice/wordy/wordy_spec.moon +++ b/exercises/practice/wordy/wordy_spec.moon @@ -1,6 +1,6 @@ Wordy = require 'wordy' -describe 'wordy', -> +describe 'wordy:', -> it 'just a number', -> result = Wordy.answer 'What is 5?' assert.are.equal 5, result diff --git a/exercises/practice/yacht/yacht_spec.moon b/exercises/practice/yacht/yacht_spec.moon index 36ea83b..1db3e6d 100644 --- a/exercises/practice/yacht/yacht_spec.moon +++ b/exercises/practice/yacht/yacht_spec.moon @@ -1,6 +1,6 @@ Yacht = require 'yacht' -describe 'yacht', -> +describe 'yacht:', -> it 'Yacht', -> result = Yacht.score 'yacht', {5, 5, 5, 5, 5} assert.is.equal 50, result diff --git a/exercises/practice/zebra-puzzle/zebra_puzzle_spec.moon b/exercises/practice/zebra-puzzle/zebra_puzzle_spec.moon index 290091d..15f645b 100644 --- a/exercises/practice/zebra-puzzle/zebra_puzzle_spec.moon +++ b/exercises/practice/zebra-puzzle/zebra_puzzle_spec.moon @@ -1,6 +1,6 @@ import drinksWater, ownsZebra from require 'zebra_puzzle' -describe 'zebra-puzzle', -> +describe 'zebra-puzzle:', -> it 'resident who drinks water', -> assert.are.equal 'Norwegian', drinksWater!