Sha256: e234e66fa2d7badb908edb6c0c6a59c717b2635c137ae319977b0d61cb7095d2

Contents?: true

Size: 876 Bytes

Versions: 27

Compression:

Stored size: 876 Bytes

Contents

if !System.get_env("EXERCISM_TEST_EXAMPLES") do
  Code.load_file("two_fer.exs", __DIR__)
end

ExUnit.start()
ExUnit.configure(exclude: :pending, trace: true)

defmodule TwoFerTest do
  use ExUnit.Case

  test "no name given" do
    assert TwoFer.two_fer() == "One for you, one for me"
  end

  @tag :pending
  test "a name given" do
    assert TwoFer.two_fer("Gilberto Barros") == "One for Gilberto Barros, one for me"
  end

  @tag :pending
  test "when the parameter is a number" do
    assert_raise FunctionClauseError, fn ->
      TwoFer.two_fer(10)
    end
  end

  @tag :pending
  test "when the parameter is an atom" do
    assert_raise FunctionClauseError, fn ->
      TwoFer.two_fer(:bob)
    end
  end

  @tag :pending
  test "when the parameter is a charlist" do
    assert_raise FunctionClauseError, fn ->
      refute TwoFer.two_fer('Jon Snow')
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/elixir/exercises/two-fer/two_fer_test.exs
trackler-2.2.1.179 tracks/elixir/exercises/two-fer/two_fer_test.exs
trackler-2.2.1.178 tracks/elixir/exercises/two-fer/two_fer_test.exs
trackler-2.2.1.177 tracks/elixir/exercises/two-fer/two_fer_test.exs
trackler-2.2.1.176 tracks/elixir/exercises/two-fer/two_fer_test.exs
trackler-2.2.1.175 tracks/elixir/exercises/two-fer/two_fer_test.exs
trackler-2.2.1.174 tracks/elixir/exercises/two-fer/two_fer_test.exs
trackler-2.2.1.173 tracks/elixir/exercises/two-fer/two_fer_test.exs
trackler-2.2.1.172 tracks/elixir/exercises/two-fer/two_fer_test.exs
trackler-2.2.1.171 tracks/elixir/exercises/two-fer/two_fer_test.exs
trackler-2.2.1.170 tracks/elixir/exercises/two-fer/two_fer_test.exs
trackler-2.2.1.169 tracks/elixir/exercises/two-fer/two_fer_test.exs
trackler-2.2.1.167 tracks/elixir/exercises/two-fer/two_fer_test.exs
trackler-2.2.1.166 tracks/elixir/exercises/two-fer/two_fer_test.exs
trackler-2.2.1.165 tracks/elixir/exercises/two-fer/two_fer_test.exs
trackler-2.2.1.164 tracks/elixir/exercises/two-fer/two_fer_test.exs
trackler-2.2.1.163 tracks/elixir/exercises/two-fer/two_fer_test.exs
trackler-2.2.1.162 tracks/elixir/exercises/two-fer/two_fer_test.exs
trackler-2.2.1.161 tracks/elixir/exercises/two-fer/two_fer_test.exs
trackler-2.2.1.160 tracks/elixir/exercises/two-fer/two_fer_test.exs