Forum: IronRuby RubySpec: Exceptions in before/after get lost in output

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Aea6cfe04952626ab630bde47ff82f89?d=identicon&s=25 Shri Borde (Guest)
on 2009-02-11 20:42
(Received via mailing list)
core/io/close_read_spec.rb does not work on my machine because it has
the following code, but I don't have "cat" on my machine.

describe "IO#close_read" do

  before :each do
    @io = IO.popen 'cat', "r+"
    @path = tmp('io.close.txt')
  end

However, running it does not report any errors in the final summary.
There is output indicating that something went bad, but if you run all
the tests together, the output scrolls past, and you won't realize it.

c:\vsl\Merlin\External\Languages\IronRuby\mspec>c:\vsl\Merlin\Main\test\scripts\ir.cmd
mspec\bin\mspec-run -fd --verbose  --excl-tag fails --excl-tag critical
--config default.mspec rubyspec/core/io/close_read_spec.rb

rubyspec/core/io/close_read_spec.rb'cat' is not recognized as an
internal or external command,
operable program or batch file.
.'cat' is not recognized as an internal or external command,
operable program or batch file.
.

Finished in 1.738000 seconds

1 file, 2 examples, 2 expectations, 0 failures, 0 errors

Shouldn't mspec report this as an error?

Thanks,
Shri
Ede2aa10c6462f1d825143879be59e38?d=identicon&s=25 Charles Oliver Nutter (Guest)
on 2009-02-12 09:45
(Received via mailing list)
Shri Borde wrote:
> core/io/close_read_spec.rb does not work on my machine because it has
> the following code, but I don’t have “cat” on my machine.
...
> However, running it does not report any errors in the final summary.
> There is output indicating that something went bad, but if you run all
> the tests together, the output scrolls past, and you won’t realize it.
...
> .'cat' is not recognized as an internal or external command,
...
> Shouldn’t mspec report this as an error?

Probably should. The problem is that popen always returns the IO streams
for the subprocess, which may be cmd reporting the 'cat' error. I
suppose it could be modified to one of the other popen variants that set
process exit status. You should bring it up on rubyspec ML or on IRC.

- Charlie
E1deaac6561498a0e7472e6268ea9ccc?d=identicon&s=25 Jimmy Schementi (Guest)
on 2009-02-17 01:19
(Received via mailing list)
There's also a dependency on "yes" in the popen specs. However, you can
get "cat" if you install the gnutools for windows, but that definitely
shouldn't be a requirement on the specs. Especially since "yes" isn't
included in the gnutools. In both cases you can probably just depend on
the current ruby install to do replicate the behavior of those commands.
Anyway, Jim, can you submit a patch to RubySpec that removes these
dependencies?

~js
This topic is locked and can not be replied to.