??????describe block?У???it??????????????it?? block??????Ρ???ε??????????????block????????????????洢???????С??????Щ????????????????Executor????????????????е????block???е????????????????????н????Executor???????£?

class Executor
  def initialize(description?? tests)
    @description = description
    @tests = tests
    @success_count = 0
    @failure_count = 0
  end
  def execute
    puts "#{@description}"
    @tests.each_pair do |name?? block|
      print " - #{name}"
      result = self.instance_eval(&block)
      result ? @success_count += 1 : @failure_count += 1
      puts result ? " SUCCESS" : " FAILURE"
    end
    summary
  end
  def summary
    puts " #{@tests.keys.size} tests?? #{@success_count} success?? #{@failure_count} failure"
  end


?????????executor???????????????describe?? block?????????????????д洢???it?? block??????executor??????????????????????????????????????ζ??executor???????????????????????????????????it?? block???????????????????????磬????dsl??????????????executor???????????????磬?????????executor????????к?????

def should_be_five(x)
  5 == x
end
 


?????????????????????it?? block??????????????????????????????????????

???????????it?? block??????洢???????????????it?? block???????????????????????Ruby??????????????????????????????????????????????????????????????????????????????Щ???????????

???????????????????should?????????????£?

true.should == true
5.should == 5
 


?????????????????????should???????????????£?

class Object
  def should
    self
  end
end
 


???????????????????????????????????????????????????????????ò?????????????????