From: tamouse mailing lists Date: 2013-02-05T22:54:39+09:00 Subject: Re: old syntax? what's going on here On Tue, Feb 5, 2013 at 7:52 AM, tamouse mailing lists wrote: > On Tue, Feb 5, 2013 at 7:47 AM, Carlo E. Prelz wrote: >> Subject: old syntax? what's going on here >> Date: mar 05 feb 13 10:33:35 +0900 >> >> Quoting tamouse mailing lists (tamouse.lists@gmail.com): >> >>> I have this in a _spec.rb file: (a gem I inherited at work) >>> >>> Open3.expects(:popen3).with do |command| >>> case part_of_command >>> when Regexp: command =~ part_of_command >>> when String: command.include?(part_of_command) >>> else raise "Can't match that" >>> end >>> end >> >> Are you sure that code ever worked? >> >> From my very worn copy of "Ruby in a nutshell": >> >> "A *when* statement's *expression* is separated from *code* by the >> reserved word *then*, a newline, or a semicolon." >> >> That colon should be a semicolon (or *then* or a newline)... > > Heh, no -- I've inherited this little bit of thing that no one in the > group has ever done much with. Sure enough, Carlos. Now it syntax checks. But on to other problems, namely with the Open3.expects and a later Open3.stub. I'm guessing I need some kind of mocker; the .gemspec refers to mocha, which I'm trying to look into.