Sha256: cebb4cee26cd00ec1af083b33d5ce04ca01f5a9a7e1b49ecf5ebd9819c80d5df

Contents?: true

Size: 919 Bytes

Versions: 18

Compression:

Stored size: 919 Bytes

Contents

require 'valise'
require 'file-sandbox'

describe Valise, "with stemming" do
  include FileSandbox

  before do
    sandbox.new :directory => "conductor"
    sandbox.new :directory => "other_dir"
    sandbox.new :file => "conductor/top", :with_contents => "conductor/exists"
    sandbox.new :file => "other_dir/middle", :with_contents => "other_dir/exists"

    @valise = Valise::Set.define do
      stemmed("stem").rw("conductor")
      stemmed("stem") do
        rw "other_dir"
      end
      rw "conductor"
    end
  end

  it "should find a file in a stemed dir" do
    @valise.find("stem/top").contents.should == "conductor/exists"
  end

  it "should find a file in a stemed dir defined in a block" do
    @valise.find("stem/middle").contents.should == "other_dir/exists"
  end

  it "should find a file in a normal dir behind stemming" do
    @valise.find("top").contents.should == "conductor/exists"
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
valise-1.2.1 spec/stemming.rb
valise-1.2.0 spec/stemming.rb
valise-1.1.4 spec/stemming.rb
valise-1.1.3 spec/stemming.rb
valise-1.1.2 spec/stemming.rb
valise-1.1.1 spec/stemming.rb
valise-1.1.0 spec/stemming.rb
valise-1.0.0 spec/stemming.rb
valise-0.9.1 spec/stemming.rb
valise-0.9.0 spec/stemming.rb
valise-0.8.2 spec/stemming.rb
valise-0.8.1 spec/stemming.rb
valise-0.8 spec/stemming.rb
valise-0.7 spec/stemming.rb
valise-0.6 spec/stemming.rb
valise-0.5 spec/stemming.rb
valise-0.4 spec/stemming.rb
valise-0.3 spec/stemming.rb