Many tests use Channel to collect data that needs to be tested. For example, 
the following in inspect_spec.rb.

  compliant_on(:ruby) do
    it "reports aborting on a killed thread" do
      c = Channel.new
      t = Thread.new { c << Thread.current.inspect; Thread.stop }
      c.receive.should include('run')
      t.inspect.should include('sleep')
      Thread.critical = true
      t.kill
      t.inspect.should include('aborting')
      Thread.critical = false
    end
  end

However, there is also ScratchPad which serves the same purpose. Why are there 
two ways of doing this, and which is the preferred one?

Also, (as we were discussing before), why does every test have to call 
ScratchPad.clear before using it. Shouldn't MSpec be doing this automatically?

Thanks,
Shri

_______________________________________________
Ironruby-core mailing list
Ironruby-core@rubyforge.org
http://rubyforge.org/mailman/listinfo/ironruby-core

Reply via email to