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.53 spec/ruco/status_bar_spec.rb
ruco-0.0.52 spec/ruco/status_bar_spec.rb
ruco-0.0.51 spec/ruco/status_bar_spec.rb
ruco-0.0.50 spec/ruco/status_bar_spec.rb
ruco-0.0.49 spec/ruco/status_bar_spec.rb
ruco-0.0.48 spec/ruco/status_bar_spec.rb
ruco-0.0.47 spec/ruco/status_bar_spec.rb
ruco-0.0.46 spec/ruco/status_bar_spec.rb
ruco-0.0.45 spec/ruco/status_bar_spec.rb
ruco-0.0.44 spec/ruco/status_bar_spec.rb
ruco-0.0.43 spec/ruco/status_bar_spec.rb
ruco-0.0.42 spec/ruco/status_bar_spec.rb
ruco-0.0.41 spec/ruco/status_bar_spec.rb
ruco-0.0.40 spec/ruco/status_bar_spec.rb
ruco-0.0.39 spec/ruco/status_bar_spec.rb
ruco-0.0.38 spec/ruco/status_bar_spec.rb
ruco-0.0.37 spec/ruco/status_bar_spec.rb
ruco-0.0.36 spec/ruco/status_bar_spec.rb
ruco-0.0.35 spec/ruco/status_bar_spec.rb
ruco-0.0.34 spec/ruco/status_bar_spec.rb