Sha256: 0a6d3b233c291943d33f5c93a804abe00cf6fa3c4180a0cc9373651def25932b

Contents?: true

Size: 659 Bytes

Versions: 1

Compression:

Stored size: 659 Bytes

Contents

require File.dirname(__FILE__)+'/../spec_helper'

describe Ginst::Project do


  context 'Finders' do
    before(:each) do
      ::Grit::Repo.stub!(:new).and_return(true)
      File.should_receive(:read).with('projects.yml').and_return("--- \n- !ruby/object:Ginst::Project \n  dir: /home/guille\n  name: guille!!\n")
      Ginst::Project.load_projects
      @prj = Ginst::Project.projects.first
    end  

    it "should be able to find by name" do
      Ginst::Project.find_by_name('guille!!').should be(@prj)
    end

    it "should be able to find by slug" do
      Ginst::Project.find_by_slug(@prj.name.slug).should be(@prj)
    end
  end

end











Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ginst-0.2.2 spec/models/project_finders_spec.rb