Sha256: 97b1d80d0578beb2256dba3b219d9acfc64c91927bf4e156152bbc1ede88f329

Contents?: true

Size: 1.05 KB

Versions: 1

Compression:

Stored size: 1.05 KB

Contents

require 'rspec'
require File.dirname(__FILE__) + "/../lib/repo"

describe "cql" do

  describe "tag searcher" do
    it "should be able to search for tags" do
      tags_given = [{"name"=>"@one", "line"=>3}, {"name"=>"@four", "line"=>3}, {"name"=>"@six", "line"=>3}, {"name"=>"@seven", "line"=>3}]
      CQL::MapReduce.has_tags(tags_given, ["@one", "@four"]).should eql true

      tags_given = [{"name"=>"@two", "line"=>3}, {"name"=>"@four", "line"=>3}, {"name"=>"@six", "line"=>3}, {"name"=>"@seven", "line"=>3}]
      CQL::MapReduce.has_tags(tags_given, ["@one", "@four"]).should eql false

      tags_given = [{"name"=>"@two", "line"=>3}, {"name"=>"@four", "line"=>3}, {"name"=>"@six", "line"=>3}, {"name"=>"@seven", "line"=>3}]
      CQL::MapReduce.has_tags(tags_given, ["@four"]).should eql true

      tags_given = [{"name"=>"@two", "line"=>3}, {"name"=>"@four", "line"=>3}, {"name"=>"@six", "line"=>3}, {"name"=>"@seven", "line"=>3}]
      CQL::MapReduce.has_tags(tags_given, ["@four", "@two", "@six", "@seven"]).should eql true
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cql-0.0.2 spec/unit_spec.rb