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.33 spec/ruco/status_bar_spec.rb
ruco-0.0.32 spec/ruco/status_bar_spec.rb
ruco-0.0.31 spec/ruco/status_bar_spec.rb
ruco-0.0.30 spec/ruco/status_bar_spec.rb
ruco-0.0.29 spec/ruco/status_bar_spec.rb
ruco-0.0.28 spec/ruco/status_bar_spec.rb
ruco-0.0.27 spec/ruco/status_bar_spec.rb
ruco-0.0.26 spec/ruco/status_bar_spec.rb
ruco-0.0.25 spec/ruco/status_bar_spec.rb
ruco-0.0.24 spec/ruco/status_bar_spec.rb
ruco-0.0.23 spec/ruco/status_bar_spec.rb
ruco-0.0.22 spec/ruco/status_bar_spec.rb
ruco-0.0.21 spec/ruco/status_bar_spec.rb
ruco-0.0.20 spec/ruco/status_bar_spec.rb
ruco-0.0.19 spec/ruco/status_bar_spec.rb
ruco-0.0.18 spec/ruco/status_bar_spec.rb
ruco-0.0.17 spec/ruco/status_bar_spec.rb
ruco-0.0.16 spec/ruco/status_bar_spec.rb
ruco-0.0.15 spec/ruco/status_bar_spec.rb
ruco-0.0.14 spec/ruco/status_bar_spec.rb