词汇:assert

vt. 断言;主张;声称;维护,坚持

相关场景

38. Mock模拟对象 define一个method,并模仿mock需要调用的特定对象;:
def alive? echo = Time.now.to_f.to_s response = get(echo) response.success? && response.body ==echo end; private get(echo) url=RUI::HTTP.build(host:@server, path: "/echo/#{echo}") HTTP.get(url.to_s) end
monitor = Monitor.new("example.com"); response = MiniTest::Mock.new ; monitor.define_singleton_method(:get) do |echo| response.expect(:success? , true); response.expect(body, echo); response end assert(monitor.alive?, "should be alive") response.verify end; 用Mock格里外部系统不稳定因素;Mock#verify
>> Effective Ruby
36.MiniTest:
Ruby标准库require('minitest/autorun');assert() and assert_equal(); require('rake/testtask'); Assertion and refutaion in MiniTest::Assertions;
>> Effective Ruby
Mr. O'HARA The South must assert ourselves by force of arms.
>> 飘 Gone with the Wind Movie Script
701. The assessor asserts that he inserted the deserted desserts in the desert with alert.
>> 800句帮助你记相似单词的句子