Sha256: 6ee08150081d6e6f2a9a524b3c7226872c13722529282d7928c2772bbbfe91fd

Contents?: true

Size: 952 Bytes

Versions: 3

Compression:

Stored size: 952 Bytes

Contents

require File.expand_path('spec/spec_helper')

describe Ruco::StatusBar do
  let(:file){ 'spec/temp.txt' }
  let(:editor){ Ruco::Editor.new(file, :lines => 5, :columns => 10) }
  let(:bar){ Ruco::StatusBar.new(editor, :columns => 10) }

  it "shows name and version" do
    bar.view.should include("Ruco #{Ruco::VERSION}") 
  end

  it "shows the file" do
    bar.view.should include(file)
  end

  it "indicates modified" do
    bar.view.should_not include('*')
    editor.insert('x')
    bar.view.should include('*')
  end

  it "indicates writable" do
    bar.view.should_not include('!')
  end

  it "indicates writable if file is missing" do
    editor.stub!(:file).and_return '/gradasadadsds'
    bar.view.should_not include('!')
  end

  it "indicates not writable" do
    editor.stub!(:file).and_return '/etc/sudoers'
    bar.view.should include('!')
  end

  it "shows line and column and right side" do
    bar.view.should =~ /1:1$/
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ruco-0.0.56 spec/ruco/status_bar_spec.rb
ruco-0.0.55 spec/ruco/status_bar_spec.rb
ruco-0.0.54 spec/ruco/status_bar_spec.rb