Sha256: a20a18830722729e8a14f17d7a74d797357a087abc00038580a863af667744c7

Contents?: true

Size: 932 Bytes

Versions: 9

Compression:

Stored size: 932 Bytes

Contents

require 'spec_helper'

describe Textpow::ScoreManager do
  it "calculates scores" do
    sp = Textpow::ScoreManager.new
    reference_scope = 'text.html.basic source.php.embedded.html string.quoted.double.php'

    sp.score('source.php string', reference_scope).should_not == 0
    sp.score('text.html source.php', reference_scope).should_not == 0
    sp.score('string source.php', reference_scope).should == 0
    sp.score('source.php text.html', reference_scope).should == 0

    sp.score('text.html source.php - string', reference_scope).should == 0
    sp.score('text.html source.php - ruby', reference_scope ).should_not == 0

    sp.score('string', reference_scope).should > sp.score('source.php', reference_scope)
    sp.score('string.quoted', reference_scope).should > sp.score('source.php', reference_scope)
    sp.score('text source string', reference_scope).should > sp.score( 'source string', reference_scope)
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
textpow-1.3.1 spec/textpow/score_manager_spec.rb
textpow-1.3.0 spec/textpow/score_manager_spec.rb
textpow1x-1.2.5 spec/textpow/score_manager_spec.rb
textpow1x-1.2.4 spec/textpow/score_manager_spec.rb
textpow1x-1.2.3 spec/textpow/score_manager_spec.rb
textpow1x-1.2.2 spec/textpow/score_manager_spec.rb
textpow1x-1.2.1 spec/textpow/score_manager_spec.rb
textpow1x-1.2.0 spec/textpow/score_manager_spec.rb
textpow1x-1.1.0 spec/textpow/score_manager_spec.rb