Sha256: 3fee6f3b8e748e17c0624985b5bd53cb44b8dff00d8680608457a792038139df

Contents?: true

Size: 632 Bytes

Versions: 3

Compression:

Stored size: 632 Bytes

Contents

# -*- coding: utf-8 -*-
require 'norikra/udf_spec_helper'

include Norikra::UDFSpecHelper

require 'norikra/udf/anomaly'

describe Norikra::UDF::Anomaly do
  f = udf_function(
    Norikra::UDF::Anomaly,
    :valueType => java.lang.Integer,
    :parameters => [[java.lang.Integer]]
  )

  it 'returns Integer values' do
    expect(f.getValueType).to eql(java.lang.Integer.java_class)
  end

  it 'returns 1 value as cumulativeDeviation' do
    (0...100).each do |i|
      f._call(:enter, i.to_java())
    end

    r = f.getValue
    expect(r).to eql(0)

    (0...100).each do |i|
      f._call(:leave, i.to_java())
    end
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
norikra-udf-anomaly-0.0.4-java spec/anomaly_spec.rb
norikra-udf-anomaly-0.0.3-java spec/anomaly_spec.rb
norikra-udf-anomaly-0.0.2-java spec/anomaly_spec.rb