From a100352595794ec1f1a1aaa5ae1654bc29d21192 Mon Sep 17 00:00:00 2001 From: skandhas Date: Fri, 30 Nov 2012 22:31:35 +0800 Subject: add test for 'Abbreviated variable assignment as returns' --- test/t/syntax.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test/t/syntax.rb') diff --git a/test/t/syntax.rb b/test/t/syntax.rb index 47221d425..0501608e5 100644 --- a/test/t/syntax.rb +++ b/test/t/syntax.rb @@ -58,3 +58,14 @@ assert('Nested const reference') do Syntax4Const::CONST1 == "hello world" and Syntax4Const::Const2.new.const1 == "hello world" end + +assert('Abbreviated variable assignment as returns') do + module Syntax4AbbrVarAsgnAsReturns + class A + def b + @c ||= 1 + end + end + end + Syntax4AbbrVarAsgnAsReturns::A.new.b == 1 +end -- cgit v1.2.3