Permalink
Browse files

feat(I): Converts roman 1-3

  • Loading branch information...
antonydenyer committed Nov 16, 2017
0 parents commit 18d663c16b4004221a3f267dd5d9e1935fc7b9fa
Showing with 73 additions and 0 deletions.
  1. +20 −0 .gitignore
  2. +2 −0 config/config.exs
  3. +7 −0 lib/roman.ex
  4. +28 −0 mix.exs
  5. +15 −0 test/roman_test.exs
  6. +1 −0 test/test_helper.exs
@@ -0,0 +1,20 @@
# The directory Mix will write compiled artifacts to.
/_build/
# If you run "mix test --cover", coverage assets end up here.
/cover/
# The directory Mix downloads your dependencies sources to.
/deps/
# Where 3rd-party dependencies like ExDoc output generated docs.
/doc/
# Ignore .fetch files in case you like to edit your project deps locally.
/.fetch
# If the VM crashes, it generates a dump, let's ignore it too.
erl_crash.dump
# Also ignore archive artifacts (built via "mix archive.build").
*.ez
@@ -0,0 +1,2 @@
use Mix.Config
@@ -0,0 +1,7 @@
defmodule Roman do
def to_roman(number) do
String.duplicate("I", number)
end
end
28 mix.exs
@@ -0,0 +1,28 @@
defmodule Rpn.Mixfile do
use Mix.Project
def project do
[
app: :rpn,
version: "0.1.0",
elixir: "~> 1.5",
start_permanent: Mix.env == :prod,
deps: deps()
]
end
# Run "mix help compile.app" to learn about applications.
def application do
[
extra_applications: [:logger]
]
end
# Run "mix help deps" to learn about dependencies.
defp deps do
[
# {:dep_from_hexpm, "~> 0.3.0"},
# {:dep_from_git, git: "https://github.com/elixir-lang/my_dep.git", tag: "0.1.0"},
]
end
end
@@ -0,0 +1,15 @@
defmodule RomanTest do
use ExUnit.Case
doctest Roman
test "one is I" do
assert Roman.to_roman(1) == "I"
end
test "two is II" do
assert Roman.to_roman(2) == "II"
end
end
@@ -0,0 +1 @@
ExUnit.start()

0 comments on commit 18d663c

Please sign in to comment.