~ubuntu-branches/ubuntu/quantal/ruby1.9.1/quantal

« back to all changes in this revision

Viewing changes to test/ruby/test_fiber.rb

  • Committer: Bazaar Package Importer
  • Author(s): Lucas Nussbaum
  • Date: 2011-09-24 19:16:17 UTC
  • mfrom: (1.1.8 upstream) (13.1.7 experimental)
  • Revision ID: james.westby@ubuntu.com-20110924191617-o1qz4rcmqjot8zuy
Tags: 1.9.3~rc1-1
* New upstream release: 1.9.3 RC1.
  + Includes load.c fixes. Closes: #639959.
* Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
190
190
    }, '[ruby-dev:40833]'
191
191
  end
192
192
 
 
193
  def test_resume_root_fiber
 
194
    assert_raise(FiberError) do
 
195
      Thread.new do
 
196
        Fiber.current.resume
 
197
      end.join
 
198
    end
 
199
  end
 
200
 
193
201
  def test_gc_root_fiber
194
202
    bug4612 = '[ruby-core:35891]'
195
203
 
200
208
      GC.start
201
209
    }, bug4612
202
210
  end
 
211
 
 
212
  def test_no_valid_cfp
 
213
    bug5083 = '[ruby-dev:44208]'
 
214
    error = assert_raise(RuntimeError) do
 
215
      Fiber.new(&Module.method(:nesting)).resume
 
216
    end
 
217
    assert_equal("Can't call on top of Fiber or Thread", error.message, bug5083)
 
218
    error = assert_raise(RuntimeError) do
 
219
      Fiber.new(&Module.method(:undef_method)).resume(:to_s)
 
220
    end
 
221
    assert_equal("Can't call on top of Fiber or Thread", error.message, bug5083)
 
222
  end
203
223
end
204
224