Re: [PATCH 7/9] test: ruby: use much more standard Ruby idioms

Subject: Re: [PATCH 7/9] test: ruby: use much more standard Ruby idioms

Date: Sun, 02 May 2021 22:00:10 +0300

To: David Bremner, Felipe Contreras, notmuch@notmuchmail.org

Cc:

From: Tomi Ollila


On Sun, May 02 2021, David Bremner wrote:

> Felipe Contreras <felipe.contreras@gmail.com> writes:
>
>> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
>> ---
>>  test/T395-ruby.sh | 20 ++++++++------------
>>  1 file changed, 8 insertions(+), 12 deletions(-)
>>
>> diff --git a/test/T395-ruby.sh b/test/T395-ruby.sh
>> index f871ddd9..f5a8d245 100755
>> --- a/test/T395-ruby.sh
>> +++ b/test/T395-ruby.sh
>> @@ -24,7 +24,7 @@ notmuch search --sort=oldest-first --output=threads tag:inbox | sed s/^thread://
>>  test_ruby <<"EOF"
>>  @q = @db.query('tag:inbox')
>>  @q.sort = Notmuch::SORT_OLDEST_FIRST
>> -for t in @q.search_threads do
>> +@q.search_threads.each do |t|
>>    puts t.thread_id
>>  end
>>  EOF
>
> The downside to these changes is that they make the tests harder for the
> non-rubyist (i.e. me) to read. So I'm not (yet) convinced this is a good
> change.

I am convinced that this is good change (like all the other changes
in this series). 

Every now and then I encounter ruby code, and have seen syntax like
`@q.search_threads.each do |t|` been used, so more exposure to that
syntax is good thing (for everyone (IMO))

Tomi
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: