class Spectro::Spec::Rule

Assert representation based on input params and an expected output. Meant to be used against an algorith to test its behavior.

Attributes

output[RW]
params[RW]

Public Class Methods

new(params, output) click to toggle source

@param [<Object>] parmas set of input params @param [<Object>] output expected result

# File lib/spectro/spec/rule.rb, line 13
def initialize params, output
  self.output = output
  self.params = params
end

Public Instance Methods

==(rule) click to toggle source
# File lib/spectro/spec/rule.rb, line 18
def == rule
  return \
    self.output == rule.output && \
    self.params == rule.params
end
to_hash() click to toggle source
# File lib/spectro/spec/rule.rb, line 24
def to_hash
  return {
    output: self.output,
    params: self.params
  }
end