class LeapCase < OpenStruct
  def name
    'test_%s' % description.downcase.gsub(/[ -]/, '_')
  end

  def do
    "Year.leap?(#{input})"
  end

  def skipped?
    index > 0
  end
end

LeapCases = proc do |data|
  JSON.parse(data)['cases'].map.with_index do |row, i|
    LeapCase.new(row.merge('index' => i))
  end
end

class LeapCase < OpenStruct
  def name
    'test_%s' % description.downcase.gsub(/[ -]/, '_')
  end

  def do
    "Year.leap?(#{input})"
  end

  def skipped?
    index > 0
  end

  def msg
    "Expected '#{expected}', #{input} is #{expected ? '' : 'not '}a leap year."
  end
end

LeapCases = proc do |data|
  JSON.parse(data)['cases'].map.with_index do |row, i|
    LeapCase.new(row.merge('index' => i))
  end
end

Add failure message to leap test generator.
Add failure message to leap test generator.

There was no failure message supplied by the test case generator, so all
tests had a blank failure message.

This patch adds an informative failure message for each test based on
the test input and expected values.
