Navigation Menu

Skip to content

Commit

Permalink
Add StubSerf for unit testing
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Apr 30, 2015
1 parent a832ca7 commit f91105d
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/unit/helper.rb
@@ -1,4 +1,4 @@
# Copyright (C) 2013-2014 Droonga Project
# Copyright (C) 2013-2015 Droonga Project
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
Expand All @@ -21,6 +21,7 @@
require_relative "helper/plugin_helper"
require_relative "helper/watch_helper"
require_relative "helper/distributed_search_planner_helper"
require_relative "helper/stub_serf"

class Test::Unit::TestCase
include ::Sandbox
Expand Down
28 changes: 28 additions & 0 deletions test/unit/helper/stub_serf.rb
@@ -0,0 +1,28 @@
# Copyright (C) 2015 Droonga Project
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License version 2.1 as published by the Free Software Foundation.
#
# This library 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
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

class StubSerf
def initialize
@have_unprocessed_messages_for = {}
end

def set_have_unprocessed_messages_for(target)
@have_unprocessed_messages_for[target] = true
end

def reset_have_unprocessed_messages_for(target)
@have_unprocessed_messages_for.delete(target)
end
end

0 comments on commit f91105d

Please sign in to comment.