From b0f53519c0f09e73a48368c868f4081d8318f5db Mon Sep 17 00:00:00 2001 From: Llewellyn Falco Date: Wed, 8 Dec 2021 17:23:37 +0000 Subject: [PATCH] initial commit --- .formatter.exs | 4 ++++ .gitignore | 25 +++++++++++++++++++++++++ README.md | 7 +++++++ hello-world.iml | 9 +++++++++ lib/hello_world.ex | 9 +++++++++ mix.exs | 28 ++++++++++++++++++++++++++++ run_tests.bat | 1 + test/hello_world_test.exs | 7 +++++++ test/test_helper.exs | 2 ++ 9 files changed, 92 insertions(+) create mode 100644 .formatter.exs create mode 100644 .gitignore create mode 100644 README.md create mode 100644 hello-world.iml create mode 100644 lib/hello_world.ex create mode 100644 mix.exs create mode 100644 run_tests.bat create mode 100644 test/hello_world_test.exs create mode 100644 test/test_helper.exs diff --git a/.formatter.exs b/.formatter.exs new file mode 100644 index 0000000..d2cda26 --- /dev/null +++ b/.formatter.exs @@ -0,0 +1,4 @@ +# Used by "mix format" +[ + inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"] +] diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8d2d0e6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,25 @@ +# 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 third-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 + +# Ignore package tarball (built via "mix hex.build"). +hello_world-*.tar + +.idea/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..5a5465e --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +## Running tests + +Execute the tests with: + +```bash +$ ./run_tests.bat +``` diff --git a/hello-world.iml b/hello-world.iml new file mode 100644 index 0000000..cb272eb --- /dev/null +++ b/hello-world.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/lib/hello_world.ex b/lib/hello_world.ex new file mode 100644 index 0000000..82ecb3f --- /dev/null +++ b/lib/hello_world.ex @@ -0,0 +1,9 @@ +defmodule HelloWorld do + @doc """ + Simply returns "Hello, World!" + """ + @spec hello :: String.t() + def hello do + "Your implementation goes here" + end +end diff --git a/mix.exs b/mix.exs new file mode 100644 index 0000000..2ba5afc --- /dev/null +++ b/mix.exs @@ -0,0 +1,28 @@ +defmodule HelloWorld.MixProject do + use Mix.Project + + def project do + [ + app: :hello_world, + version: "0.1.0", + # elixir: "~> 1.8", + 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 diff --git a/run_tests.bat b/run_tests.bat new file mode 100644 index 0000000..a10ab11 --- /dev/null +++ b/run_tests.bat @@ -0,0 +1 @@ +mix test \ No newline at end of file diff --git a/test/hello_world_test.exs b/test/hello_world_test.exs new file mode 100644 index 0000000..cfd7952 --- /dev/null +++ b/test/hello_world_test.exs @@ -0,0 +1,7 @@ +defmodule HelloWorldTest do + use ExUnit.Case + + test "says 'Hello, World!'" do + assert HelloWorld.hello() == "Hello, World!" + end +end diff --git a/test/test_helper.exs b/test/test_helper.exs new file mode 100644 index 0000000..35fc5bf --- /dev/null +++ b/test/test_helper.exs @@ -0,0 +1,2 @@ +ExUnit.start() +ExUnit.configure(exclude: :pending, trace: true)