Navigation Menu

Skip to content

Commit

Permalink
Define buffered and not buffered versions as base classes
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Apr 30, 2015
1 parent 38f23e2 commit ae0d6ff
Showing 1 changed file with 24 additions and 18 deletions.
42 changes: 24 additions & 18 deletions test/unit/test_engine_node.rb
Expand Up @@ -80,26 +80,36 @@ def test_to_json(data)
assert_equal(data[:expected], json)
end

class Buffered < Droonga::EngineNode
private
def create_buffer
[0]
end
end

class NotBuffered < Droonga::EngineNode
private
def create_buffer
[]
end
end

class FromServiceProvider < self
class EngineNode < Droonga::EngineNode
class BufferedEngineNode < Buffered
private
def sender_role
Droonga::NodeRole::SERVICE_PROVIDER
end
end

class BufferedEngineNode < EngineNode
class NotBufferedEngineNode < NotBuffered
private
def create_buffer
[0]
def sender_role
Droonga::NodeRole::SERVICE_PROVIDER
end
end

class NotBufferedEngineNode < EngineNode
private
def create_buffer
[]
end
class EngineNode < NotBufferedEngineNode
end

data(:same_role => {
Expand Down Expand Up @@ -235,25 +245,21 @@ def test_status(data)
end

class FromAbsorbSource < self
class EngineNode < Droonga::EngineNode
class BufferedEngineNode < Buffered
private
def sender_role
Droonga::NodeRole::ABSORB_SOURCE
end
end

class BufferedEngineNode < EngineNode
class NotBufferedEngineNode < NotBuffered
private
def create_buffer
[0]
def sender_role
Droonga::NodeRole::ABSORB_SOURCE
end
end

class NotBufferedEngineNode < EngineNode
private
def create_buffer
[]
end
class EngineNode < NotBufferedEngineNode
end

data(:same_role => {
Expand Down

0 comments on commit ae0d6ff

Please sign in to comment.