summaryrefslogtreecommitdiff
path: root/spec/indent_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/indent_spec.rb')
-rw-r--r--spec/indent_spec.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/indent_spec.rb b/spec/indent_spec.rb
index 29c07a5f..a705d8bc 100644
--- a/spec/indent_spec.rb
+++ b/spec/indent_spec.rb
@@ -305,6 +305,14 @@ OUTPUT
expect(@indent.indent(input)).to eq output
end
+ it "should not raise error, if MIDWAY_TOKENS are used without indentation" do
+ expect { @indent.indent("when") }.not_to raise_error
+ expect { @indent.reset.indent("else") }.not_to raise_error
+ expect { @indent.reset.indent("elsif") }.not_to raise_error
+ expect { @indent.reset.indent("ensure") }.not_to raise_error
+ expect { @indent.reset.indent("rescue") }.not_to raise_error
+ end
+
describe "nesting" do
test = File.read("spec/fixtures/example_nesting.rb")