Sha256: dd9367c34edf988594ccf68ae054cbca063de3b54099d530865d1d983b33c258

Contents?: true

Size: 1.14 KB

Versions: 5

Compression:

Stored size: 1.14 KB

Contents

require "spec_helper"

describe Nachos::Main do

  describe "info" do
    it "shows summary of what is up" do
      main = Nachos::Main.new(Nachos::CLI.new)
      main.stubs(:github_user => "jdoe")
      main.stubs(:github_summary => "github summary")
      main.info.should include("jdoe")
      main.info.should include(Nachos::VERSION)
      main.info.should include("github summary")
    end
  end
  
  describe "sync" do
    it "syncs all repos" do
      main = Nachos::Main.new(Nachos::CLI.new)
      main.stubs(:watched).returns([])
      main.sync
    end
  end

  describe "repo_exists?" do
    it "returns true if dir exists" do
      Pathname.any_instance.expects(:directory?).returns(true)
      repo = Hashie::Mash.new(:owner => "jdoe", :name => "project")
      main = Nachos::Main.new(Nachos::CLI.new)
      main.repo_exists?(repo).should be_true
    end
    
    it "returns false if dir does not exist" do
      Pathname.any_instance.expects(:directory?).returns(false)
      repo = Hashie::Mash.new(:owner => "jdoe", :name => "project")
      main = Nachos::Main.new(Nachos::CLI.new)
      main.repo_exists?(repo).should be_false
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
nachos-0.0.6 spec/nachos/main_spec.rb
nachos-0.0.5 spec/nachos/main_spec.rb
nachos-0.0.4 spec/nachos/main_spec.rb
nachos-0.0.3 spec/nachos/main_spec.rb
nachos-0.0.2 spec/nachos/main_spec.rb