trackler 2.2.1.152 → 2.2.1.153
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/trackler/version.rb +1 -1
- data/tracks/elixir/config.json +10 -0
- data/tracks/elixir/exercises/two-fer/README.md +52 -0
- data/tracks/elixir/exercises/two-fer/example.exs +8 -0
- data/tracks/elixir/exercises/two-fer/two_fer.exs +8 -0
- data/tracks/elixir/exercises/two-fer/two_fer_test.exs +40 -0
- metadata +5 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e991216d9ea33bd87ff86e3588f1cf95947a7897
|
4
|
+
data.tar.gz: e97ed241757d28be0a367f79cef2dd736c706bfd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dde1e87b24a0de86ea3d2de1bb5ac31f6e33c2d45cc907682a8518e76c65aa9cd611a09c35603feee4df96a5550a2bd146817ab61f161f71357c63cfdaab69da
|
7
|
+
data.tar.gz: 7551620e5417926310541ccb3c2f711610a817149d068a2b5c28df0f1f2e2c2b608272fc6cab46ae71801f239adf74b1a6ebd684225f907763f3a0880e4d035a
|
data/lib/trackler/version.rb
CHANGED
data/tracks/elixir/config.json
CHANGED
@@ -816,6 +816,16 @@
|
|
816
816
|
],
|
817
817
|
"unlocked_by": null,
|
818
818
|
"uuid": "7ed99829-acd8-4724-b92f-85146f1709f9"
|
819
|
+
},
|
820
|
+
{
|
821
|
+
"core": false,
|
822
|
+
"difficulty": 1,
|
823
|
+
"slug": "two-fer",
|
824
|
+
"topics": [
|
825
|
+
"strings"
|
826
|
+
],
|
827
|
+
"unlocked_by": null,
|
828
|
+
"uuid": "e7f3280e-0bef-4fac-8a69-cbfa2e5f818a"
|
819
829
|
}
|
820
830
|
],
|
821
831
|
"foregone": [
|
@@ -0,0 +1,52 @@
|
|
1
|
+
# Two Fer
|
2
|
+
|
3
|
+
Two-fer or 2-fer is short for two for one. One for you and one for me.
|
4
|
+
|
5
|
+
````bash
|
6
|
+
$ elixir "One for X, one for me."
|
7
|
+
```
|
8
|
+
|
9
|
+
When X is a name or "you".
|
10
|
+
|
11
|
+
If the given name is "Dunk", the result should be "One for Dunk, one for me." If no name is given, the result should be "One for you, one for me."
|
12
|
+
|
13
|
+
## Running tests
|
14
|
+
|
15
|
+
Execute the tests with:
|
16
|
+
|
17
|
+
```bash
|
18
|
+
$ elixir two_fer_test.exs
|
19
|
+
```
|
20
|
+
|
21
|
+
### Pending tests
|
22
|
+
|
23
|
+
In the test suites, all but the first test have been skipped.
|
24
|
+
|
25
|
+
Once you get a test passing, you can unskip the next one by
|
26
|
+
commenting out the relevant `@tag :pending` with a `#` symbol.
|
27
|
+
|
28
|
+
For example:
|
29
|
+
|
30
|
+
```elixir
|
31
|
+
# @tag :pending
|
32
|
+
test "shouting" do
|
33
|
+
assert Bob.hey("WATCH OUT!") == "Whoa, chill out!"
|
34
|
+
end
|
35
|
+
```
|
36
|
+
|
37
|
+
Or, you can enable all the tests by commenting out the
|
38
|
+
`ExUnit.configure` line in the test suite.
|
39
|
+
|
40
|
+
```elixir
|
41
|
+
# ExUnit.configure exclude: :pending, trace: true
|
42
|
+
```
|
43
|
+
|
44
|
+
For more detailed information about the Elixir track, please
|
45
|
+
see the [help page](http://exercism.io/languages/elixir).
|
46
|
+
|
47
|
+
## Source
|
48
|
+
|
49
|
+
This is an exercise to introduce users to basic programming constructs, just after Hello World. https://en.wikipedia.org/wiki/Two-fer
|
50
|
+
|
51
|
+
## Submitting Incomplete Solutions
|
52
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
@@ -0,0 +1,40 @@
|
|
1
|
+
if !System.get_env("EXERCISM_TEST_EXAMPLES") do
|
2
|
+
Code.load_file("two_fer.exs", __DIR__)
|
3
|
+
end
|
4
|
+
|
5
|
+
ExUnit.start()
|
6
|
+
ExUnit.configure(exclude: :pending, trace: true)
|
7
|
+
|
8
|
+
defmodule TwoFerTest do
|
9
|
+
use ExUnit.Case
|
10
|
+
|
11
|
+
test "no name given" do
|
12
|
+
assert TwoFer.two_fer() == "One for you, one for me"
|
13
|
+
end
|
14
|
+
|
15
|
+
@tag :pending
|
16
|
+
test "a name given" do
|
17
|
+
assert TwoFer.two_fer("Gilberto Barros") == "One for Gilberto Barros, one for me"
|
18
|
+
end
|
19
|
+
|
20
|
+
@tag :pending
|
21
|
+
test "when the parameter is a number" do
|
22
|
+
assert_raise FunctionClauseError, fn ->
|
23
|
+
TwoFer.two_fer(10)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
@tag :pending
|
28
|
+
test "when the parameter is an atom" do
|
29
|
+
assert_raise FunctionClauseError, fn ->
|
30
|
+
TwoFer.two_fer(:bob)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
@tag :pending
|
35
|
+
test "when the parameter is a charlist" do
|
36
|
+
assert_raise FunctionClauseError, fn ->
|
37
|
+
refute TwoFer.two_fer('Jon Snow')
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trackler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.1.
|
4
|
+
version: 2.2.1.153
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Katrina Owen
|
@@ -4555,6 +4555,10 @@ files:
|
|
4555
4555
|
- tracks/elixir/exercises/twelve-days/example.exs
|
4556
4556
|
- tracks/elixir/exercises/twelve-days/twelve_days.exs
|
4557
4557
|
- tracks/elixir/exercises/twelve-days/twelve_days_test.exs
|
4558
|
+
- tracks/elixir/exercises/two-fer/README.md
|
4559
|
+
- tracks/elixir/exercises/two-fer/example.exs
|
4560
|
+
- tracks/elixir/exercises/two-fer/two_fer.exs
|
4561
|
+
- tracks/elixir/exercises/two-fer/two_fer_test.exs
|
4558
4562
|
- tracks/elixir/exercises/word-count/README.md
|
4559
4563
|
- tracks/elixir/exercises/word-count/example.exs
|
4560
4564
|
- tracks/elixir/exercises/word-count/word_count.exs
|