From 4d667eff61ed38639a31464f85864b7df63b6dad Mon Sep 17 00:00:00 2001 From: Tom Gurion Date: Thu, 6 Apr 2017 00:30:38 +0100 Subject: [PATCH] Add string interpolation koan. Fix #184 --- lib/koans/02_strings.ex | 4 ++++ test/koans/strings_koan_test.exs | 1 + 2 files changed, 5 insertions(+) diff --git a/lib/koans/02_strings.ex b/lib/koans/02_strings.ex index 6d798dc..c4a5008 100644 --- a/lib/koans/02_strings.ex +++ b/lib/koans/02_strings.ex @@ -7,6 +7,10 @@ defmodule Strings do assert "hello" == ___ end + koan "Values may be inserted into strings by interpolation" do + assert "1 + 1 = #{1 + 1}" == ___ + end + koan "They can be put together" do assert "hello world" == ___ <> "world" end diff --git a/test/koans/strings_koan_test.exs b/test/koans/strings_koan_test.exs index 2aa6f35..9287716 100644 --- a/test/koans/strings_koan_test.exs +++ b/test/koans/strings_koan_test.exs @@ -5,6 +5,7 @@ defmodule StringTests do test "Strings" do answers = [ "hello", + "1 + 1 = 2", "hello ", "hello world", "An incredible day",