On Tue, Feb 5, 2013 at 8:27 AM,  <sto.mar / web.de> wrote:
> Am 05.02.2013 15:08, schrieb Carlo E. Prelz:
>
>>         Subject: Re: old syntax? what's going on here
>>         Date: mar 05 feb 13 10:54:39 +0900
>>
>> Quoting tamouse mailing lists (tamouse.lists / gmail.com):
>>
>>> 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.
>>
>>
>> (it is Carlo, not Carlos - I am Italian... Nothing against the
>> Spaniards and the Portuguese, of course)
>>
>> I never used Open3 (never needed). But if I type
>>
>> ri expects
>>
>> nothing appears. There must be yet another syntax error, in the sense
>> that you should have expect, not expects. Indeed, if I type
>
>
> No! As long as you do not have the same gems on your machine as
> have been used for tamouse's project, that tells you nothing.
>
> The Mocha::Mock class from the mentioned mocha gem class
> *has* an expects method.
>
>
>> ri expect
>>
>> I obtain (among others):
>>
>> --8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<--
>> === Implementation from Mock
>>
>> ------------------------------------------------------------------------------
>>    expect(name, retval, args=[], &blk)
>>
>>
>> ------------------------------------------------------------------------------
>>
>> Expect that method name is called, optionally with args or a blk, and
>> returns
>> retval.
>>
>>    @mock.expect(:meaning_of_life, 42)
>>    @mock.meaning_of_life # => 42
>>
>>    @mock.expect(:do_something_with, true, [some_obj, true])
>>    @mock.do_something_with(some_obj, true) # => true
>>
>>    @mock.expect(:do_something_else, true) do |a1, a2|
>>      a1 == "buggs" && a2 == :bunny
>>    end
>>
>> args is compared to the expected args using case equality (ie, the
>> '==='
>> operator), allowing for less specific expectations.
>>
>>    @mock.expect(:uses_any_string, true, [String])
>>    @mock.uses_any_string("foo") # => true
>>    @mock.verify  # => true
>>
>>    @mock.expect(:uses_one_string, true, ["foo"]
>>    @mock.uses_one_string("bar") # => true
>>    @mock.verify  # => raises MockExpectationError
>> --8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<--
>>
>> Then, if I ask ri for Mock, nothing comes out, I never used Mock
>> myself - I know nothing about that. Hmm... looks like this doc is a
>> leftover from an old installation (mock seems to have been part of
>> Ruby in the past but it is not there anymore). I expect you will find
>> stuff about Mock on the net.
>>
>> Carlo
>
>
> No!
>
> The Mock class you are talking about is part of MiniTest,
> and rather new.
>
>
> --
> <https://github.com/stomar/>
>

This is the ruby_pgp module, which seems quite old(?) but has been
sucked into our code base somehow. I'm at a loss to understand how
this could actually be even passing tests, until I realized there are
no tests for it either! (The gem has tests, lots of them, but they
aren't run in our own spec tests.) It only cropped up now as we're
finally using the functionality that it offers at this stage of the
game. It's a wrapper for the gpg command.

I'm ripping it out of our code base and restoring it to proper Gem
status so we can use it better. I've looked at other gpg gems, but
they would involve more work to just get the basic thing we need done,
which is just encrypt and decrypt a single file in a standalone job
that runs once a week.

The mocha gem is mentioned in the gemspec (there's no Gemfile) but I
can't figure out where it gets included in this (yet!).