Sha256: e70f505f0c121a45d32b787a7afb2ee532085d6f87607ab18f7ead15876fd8b9

Contents?: true

Size: 715 Bytes

Versions: 3

Compression:

Stored size: 715 Bytes

Contents

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

describe Tabby::Editor do
  let(:basedir) { Tabby::TABBYDIR }
  let(:path)    { basedir.join("helicopter.rb") }
  let(:editor)  { Tabby::Editor.new("helicopter") }

  before do
    Fakeout.deactivate!
    editor.stub(:path) { path }
  end

  it "should open a project file with $EDITOR" do
    path.stub(:exist?) { true }
    editor.should_receive(:system).with("$EDITOR #{path.expand_path}")
    editor.run!
  end

  it "should create a new project if it doesn't exist" do
    path.stub(:exist?) { false }
    creator = mock("Tabby::Creator").as_null_object
    Tabby::Creator.should_receive(:new).with("helicopter").and_return(creator)
    editor.run!
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

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