aboutsummaryrefslogtreecommitdiffstats
path: root/test/indent/ruby.rb
diff options
context:
space:
mode:
authorDmitry Gutov2013-10-21 07:50:06 +0400
committerDmitry Gutov2013-10-21 07:50:06 +0400
commit8c1ae48154e4c6935da3120362ea535f0dddfec5 (patch)
treed8c450d065eeb0820bbcd4ddd7f9233b73a1af69 /test/indent/ruby.rb
parenta9f8deecce02a4acdb5259297878799b69d56a21 (diff)
downloademacs-8c1ae48154e4c6935da3120362ea535f0dddfec5.tar.gz
emacs-8c1ae48154e4c6935da3120362ea535f0dddfec5.zip
* lisp/progmodes/ruby-mode.el (ruby-mode-map): Add binding for
`smie-down-list'. (ruby-smie--args-separator-p): Check that there's no newline between method call and its arguments. (ruby-smie-rules): Handle new cases: curly block with and without parameters, hash surrounded with parens, block passed to paren-less method call. * test/indent/ruby.rb: New examples for indentation of blocks. Example of hash inside parens that inflooped before this commit.
Diffstat (limited to 'test/indent/ruby.rb')
-rw-r--r--test/indent/ruby.rb25
1 files changed, 17 insertions, 8 deletions
diff --git a/test/indent/ruby.rb b/test/indent/ruby.rb
index ef89ebc1aa7..56966ebb8c0 100644
--- a/test/indent/ruby.rb
+++ b/test/indent/ruby.rb
@@ -40,6 +40,11 @@ foo = { # ruby-deep-indent-disabled
40 a: b 40 a: b
41} 41}
42 42
43foo({
44 a: b,
45 c: d
46 })
47
43foo = [ # ruby-deep-indent-disabled 48foo = [ # ruby-deep-indent-disabled
44 1 49 1
45] 50]
@@ -165,6 +170,18 @@ method? arg1,
165method! arg1, 170method! arg1,
166 arg2 171 arg2
167 172
173it "is a method call with block" do |asd|
174 foo
175end
176
177it("is too!") {
178 bar
179}
180
181and_this_one(has) { |block, parameters|
182 tee
183}
184
168# Examples below still fail with `ruby-use-smie' on: 185# Examples below still fail with `ruby-use-smie' on:
169 186
170foo + 187foo +
@@ -192,11 +209,3 @@ method :foo,
192 209
193method (a + b), 210method (a + b),
194 c 211 c
195
196it "is a method call with block" do
197 foo
198end
199
200it("is too!") {
201 bar
202}