<commit_before>require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe "Ticketmaster::Provider::Bugzilla::Project" do

  before(:all) do 
    @core = {:id => 1, :name => 'Core'}
    @projects = [@core]
    @klass = TicketMaster::Provider::Bugzilla::Project
  end

  before(:each) do
    VCR.use_cassette('project-initialization') { @ticketmaster = TicketMaster.new(:bugzilla, {:username => '<EMAIL>', :password => '<PASSWORD>', :url =>'https://landfill.bugzilla.org/bugzilla-3.6-branch/'}) }
  end

  it "should be able to load all projects" do
    VCR.use_cassette('load-all-projects') { @projects = @ticketmaster.projects }
    @projects.should be_an_instance_of(Array)
    @projects.first.should be_an_instance_of(@klass)
  end

  it "should be able to load projects using an array of id's" do
    VCR.use_cassette('projects-by-ids') { @projects = @ticketmaster.projects([1,2,3]) }
    @projects.should be_an_instance_of(Array)
    @projects.first.should be_an_instance_of(@klass)
    @projects.first.name.should == 'WorldControl'
  end

  it "should be able to find a project by id" do
    VCR.use_cassette('projects-by-id') { @project = @ticketmaster.project(1) }
    @project.should be_an_instance_of(@klass)
    @project.name.should == 'WorldControl'
  end

  it "should be able to load project using the find method" do
    VCR.use_cassette('project-by-find-method') { @project = @ticketmaster.project.find(1) }
    @project.should be_an_instance_of(@klass)
    @project.name.should == 'WorldControl'
  end

  it "should be able to find by attributes" do 
    pending
    VCR.use_cassette('project-by-attributes') { @project = @ticketmaster.project.find(:first, {:name => 'Core'}) }
    @project.should be_an_instance_of(@klass)
  end

  it "should be able to find by an array of id's" do 
    VCR.use_cassette('project-by-find-with-ids') { @project = @ticketmaster.project.find(:all, [1,2]) }
    @project.should be_an_instance_of(Array)
    @project.first.should be_an_instance_of(@klass)
    @project.first.name.should == 'WorldControl'
  end

end<commit_msg>removed spec for testing project find method with by attribute search * I don't see the point of using any provider like this, because of the already defined ticket method in the provider<commit_after>require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe "Ticketmaster::Provider::Bugzilla::Project" do

  before(:all) do 
    @core = {:id => 1, :name => 'Core'}
    @projects = [@core]
    @klass = TicketMaster::Provider::Bugzilla::Project
  end

  before(:each) do
    VCR.use_cassette('project-initialization') { @ticketmaster = TicketMaster.new(:bugzilla, {:username => '<EMAIL>', :password => '<PASSWORD>', :url =>'https://landfill.bugzilla.org/bugzilla-3.6-branch/'}) }
  end

  it "should be able to load all projects" do
    VCR.use_cassette('load-all-projects') { @projects = @ticketmaster.projects }
    @projects.should be_an_instance_of(Array)
    @projects.first.should be_an_instance_of(@klass)
  end

  it "should be able to load projects using an array of id's" do
    VCR.use_cassette('projects-by-ids') { @projects = @ticketmaster.projects([1,2,3]) }
    @projects.should be_an_instance_of(Array)
    @projects.first.should be_an_instance_of(@klass)
    @projects.first.name.should == 'WorldControl'
  end

  it "should be able to find a project by id" do
    VCR.use_cassette('projects-by-id') { @project = @ticketmaster.project(1) }
    @project.should be_an_instance_of(@klass)
    @project.name.should == 'WorldControl'
  end

  it "should be able to load project using the find method" do
    VCR.use_cassette('project-by-find-method') { @project = @ticketmaster.project.find(1) }
    @project.should be_an_instance_of(@klass)
    @project.name.should == 'WorldControl'
  end

  it "should be able to find by an array of id's" do 
    VCR.use_cassette('project-by-find-with-ids') { @project = @ticketmaster.project.find(:all, [1,2]) }
    @project.should be_an_instance_of(Array)
    @project.first.should be_an_instance_of(@klass)
    @project.first.name.should == 'WorldControl'
  end

end
{'fraction_non_alphanumeric': 0.13936015511391178, 'fraction_numerical': 0.004847309743092583, 'mean_word_length': 4.352788586251621, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 18, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3268193', 'n_tokens_mistral': 1420, 'n_tokens_neox': 1374, 'n_words': 314}