Skip to content
This repository
tree: d7e125a841
Fetching contributors…

Cannot retrieve contributors at this time

file 43 lines (37 sloc) 1.179 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
$:.unshift "spec/"
require 'rubygems'
class Keys
  def self.method_missing(meth, *args, &block); end
end
require 'xiki/remote'
require 'xiki/core_ext'

describe Remote, "#calculate_local_path" do
  it "should put dashes in path" do
    Remote.calculate_local_path("/tmp/foo.txt", "server.com").should == "/tmp/remote_rb/server.com,tmp,foo.txt"
  end
end

describe Remote, "#calculate_remote_path" do
  it "should remove dashes from path" do
    Remote.calculate_remote_path("/tmp/remote_rb/server.com,tmp,foo.txt").should == "/tmp/foo.txt"
  end
end

# describe Remote, "#save_file" do
# it "should save local file if modified" do
# View = mock 'View'
# View.should_receive(:path).and_return '/tmp/remote_rb/tmp,hey.txt'
# Remote.save_file
# end
# end


describe Remote, "#save_file" do
  before(:each) do
    $el = mock 'el'
    $el.stub!(:buffer_modified_p).and_return false
    View = mock 'View'
    View.stub!(:path).and_return '/tmp/remote_rb/tmp,hey.txt'
    View.stub!(:file)#.and_return '/tmp/remote_rb/tmp,hey.txt'
    View.stub!(:beep)#.and_return '/tmp/remote_rb/tmp,hey.txt'
  end

  it "should save remotely" do
    # Remote.save_file
  end
end
Something went wrong with that request. Please try again.