File tree Expand file tree Collapse file tree 2 files changed +28
-3
lines changed Expand file tree Collapse file tree 2 files changed +28
-3
lines changed Original file line number Diff line number Diff line change 1
1
require 'spec_helper'
2
2
3
3
describe "Indenting" do
4
- context "one liner functions inside do block declaring " do
5
- it "with fn syntax" do
4
+ context "single body functions inside do block" do
5
+ it "is declared with fn syntax" do
6
6
assert_correct_indenting <<-EOF
7
7
def do
8
8
some_func = fn x -> x end
9
9
end
10
10
EOF
11
11
end
12
12
13
- it "with function syntax" do
13
+ it "is declared with function syntax" do
14
14
assert_correct_indenting <<-EOF
15
15
def do
16
16
some_func = function do x -> x end
@@ -19,6 +19,16 @@ def do
19
19
end
20
20
21
21
it "spans in multiple lines" do
22
+ assert_correct_indenting <<-EOF
23
+ def test do
24
+ assert_raise Queue.Empty, fn ->
25
+ Q.new |> Q.deq!
26
+ end
27
+ end
28
+ EOF
29
+ end
30
+
31
+ it "spans in multiple lines inside parentheses" do
22
32
assert_correct_indenting <<-EOF
23
33
defmodule Test do
24
34
def lol do
Original file line number Diff line number Diff line change
1
+ require 'spec_helper'
2
+
3
+ describe "Indenting" do
4
+ context "documentation" do
5
+ it "with end keyword" do
6
+ assert_correct_indenting <<-EOF
7
+ defmodule Test do
8
+ @doc ""
9
+ end
10
+ ""
11
+ end
12
+ EOF
13
+ end
14
+ end
15
+ end
You can’t perform that action at this time.
0 commit comments