Permalink
Browse files

Test that oneline conditionals are accepted

  • Loading branch information...
1 parent b49f77d commit 97e41086a8ca040e40955a6a968c0b50ae953222 @nelstrom committed Dec 13, 2012
Showing with 24 additions and 0 deletions.
  1. +18 −0 test/rubyblock_test.vim
  2. +6 −0 test/samples/oneline-conditionals.rb
View
18 test/rubyblock_test.vim
@@ -248,3 +248,21 @@ describe 'rubyblocks with a method call'
end
end
+
+describe 'oneline conditionals'
+
+ before
+ silent tabnew test/samples/oneline-conditionals.rb
+ end
+
+ after
+ silent tabclose
+ end
+
+ it 'is not confused by trailing if/unless statements'
+ TODO
+ Expect SelectInsideFrom(2, '^') ==# [2, 2, 5]
+ Expect SelectAroundFrom(1, '^') ==# [1, 1, 6]
+ end
+
+end
View
6 test/samples/oneline-conditionals.rb
@@ -0,0 +1,6 @@
+def adjust_format_for_istar
+ request.format = :iphone if iphone?
+ request.format = :ipad if ipad?
+ request.format = :js if request.xhr?
+ request.format = :html unless request.xml?
+end

0 comments on commit 97e4108

Please sign in to comment.