Sha256: 2924e262e29a39a528dc24051acdf8608fd92d07e7d0469e8907f2ecfe326e5c

Contents?: true

Size: 762 Bytes

Versions: 3

Compression:

Stored size: 762 Bytes

Contents

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

describe Tabby::CLI do
  let(:path)   { Tabby::TABBYDIR.join("battle.rb") }
  let(:runner) { mock('Tabby::Runner').as_null_object }

  before do
    Fakeout.activate!
    Tempfile.stub(:new).and_return { FakeFile.new }
  end

  it "should open an existing project" do
    Tabby::Runner.should_receive(:new).with("battle").and_return(runner)
    Tabby::CLI.start(["open", "battle"])
  end

  it "should create an empty project config" do
    Tabby::CLI.start(["create", "battle"])
    path.should exist
  end

  it "should list available projects" do
    FileUtils.mkdir_p(Tabby::TABBYDIR)
    FileUtils.touch(path.expand_path.to_s)

    Tabby::CLI.start(["list"])
    stdout.should include "- battle"
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
tabby2-0.3.0 spec/tabby/cli_spec.rb
tabby2-0.2.1 spec/tabby/cli_spec.rb
tabby-0.1.0 spec/tabby/cli_spec.rb