Kouhei Sutou
null+****@clear*****
Mon Aug 12 11:57:47 JST 2013
Kouhei Sutou 2013-08-12 11:57:47 +0900 (Mon, 12 Aug 2013) New Revision: c86d18b51e3a7830d194bad43687a0413ac7018f https://github.com/groonga/grntest/commit/c86d18b51e3a7830d194bad43687a0413ac7018f Message: Extract errors Added files: lib/grntest/error.rb Modified files: lib/grntest/tester.rb Added: lib/grntest/error.rb (+39 -0) 100644 =================================================================== --- /dev/null +++ lib/grntest/error.rb 2013-08-12 11:57:47 +0900 (6da714a) @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +# +# Copyright (C) 2012-2013 Kouhei Sutou <kou �� clear-code.com> +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +module Grntest + class Error < StandardError + end + + class NotExist < Error + attr_reader :path + def initialize(path) + @path = path + super("<#{path}> doesn't exist.") + end + end + + class ParseError < Error + attr_reader :type, :content, :reason + def initialize(type, content, reason) + @type = type + @content = content + @reason = reason + super("failed to parse <#{@type}> content: #{reason}: <#{content}>") + end + end +end Modified: lib/grntest/tester.rb (+1 -21) =================================================================== --- lib/grntest/tester.rb 2013-08-12 11:50:30 +0900 (1582244) +++ lib/grntest/tester.rb 2013-08-12 11:57:47 +0900 (36173f4) @@ -29,32 +29,12 @@ require "msgpack" require "groonga/command" require "grntest/version" +require "grntest/error" require "grntest/reporters" require "grntest/execution-context" module Grntest class Tester - class Error < StandardError - end - - class NotExist < Error - attr_reader :path - def initialize(path) - @path = path - super("<#{path}> doesn't exist.") - end - end - - class ParseError < Error - attr_reader :type, :content, :reason - def initialize(type, content, reason) - @type = type - @content = content - @reason = reason - super("failed to parse <#{@type}> content: #{reason}: <#{content}>") - end - end - class << self def run(argv=nil) argv ||= ARGV.dup -------------- next part -------------- HTML����������������������������... Télécharger