Sha256: d80b78c032b0e801af00517764b56f60d6c14a4e212db6f1138632225c5c7fc4

Contents?: true

Size: 867 Bytes

Versions: 51

Compression:

Stored size: 867 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
end

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
ruco-0.0.13 spec/ruco/status_bar_spec.rb
ruco-0.0.12 spec/ruco/status_bar_spec.rb
ruco-0.0.11 spec/ruco/status_bar_spec.rb
ruco-0.0.10 spec/ruco/status_bar_spec.rb
ruco-0.0.9 spec/ruco/status_bar_spec.rb
ruco-0.0.8 spec/ruco/status_bar_spec.rb
ruco-0.0.7 spec/ruco/status_bar_spec.rb
ruco-0.0.6 spec/ruco/status_bar_spec.rb
ruco-0.0.5 spec/ruco/status_bar_spec.rb
ruco-0.0.4 spec/ruco/status_bar_spec.rb
ruco-0.0.2 spec/ruco/status_bar_spec.rb