Sha256: d92f25707d8907fdde0995f09b36b215276c521442db6a8da5cfcf5399b9f9cd

Contents?: true

Size: 687 Bytes

Versions: 4

Compression:

Stored size: 687 Bytes

Contents

require 'spec_helper'

describe Reputation::Functions::Step do

  it_should_behave_like "any function"

  describe "instance method" do
    
    describe "'f'" do
      it "should have an adjustable step" do
        function_1 = Reputation::Functions::Step.new :c => 1
        function_2 = Reputation::Functions::Step.new :c => 2
        function_3 = Reputation::Functions::Step.new :c => 3
        
        function_1.f(0.99).should eql -1
        function_1.f(1).should eql 1
        
        function_2.f(1.99).should eql -1
        function_2.f(2).should eql 1
        
        function_3.f(2.99).should eql -1
        function_3.f(3).should eql 1
      end
    end
    
  end
  
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
reputation-0.0.5 spec/functions/step_spec.rb
reputation-0.0.4 spec/functions/step_spec.rb
reputation-0.0.3 spec/functions/step_spec.rb
reputation-0.0.2 spec/functions/step_spec.rb