Sha256: 7b650be7c5a837df27c8375bace9f3053ac0ff93fdf0b016209363927d2d062b

Contents?: true

Size: 1002 Bytes

Versions: 5

Compression:

Stored size: 1002 Bytes

Contents

require 'spec_helper'

describe Vimpack::Utils::Vimscripts do
  class VimscriptsTest
    include Vimpack::Utils::Vimscripts
  end

  let(:vimscripts) { VimscriptsTest }

  context ".vimscripts" do

    it "should be a collection of script attribute hashes" do
      vimscripts.vimscripts.first["n"].should == 'test.vim'
    end
  end

  context ".search_vimscripts" do

    it "should return a collection of hash like objects" do
      vimscripts.search_vimscripts('rails').each do |script|
        script.should respond_to(:keys)
      end
    end

    it "all scripts returned should include the query in the name" do
      vimscripts.search_vimscripts('rails').each do |script|
        (script[:description].downcase.include?('rails') or
         script[:name].downcase.include?('rails')).should be_true
      end
    end

    it "should leave the vimscripts in place" do
      vimscripts.search_vimscripts('rails')
      vimscripts.vimscripts.count.should be_between(3000, 4000)
    end

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
vimpack-0.0.4 spec/vimpack/utils/vimscripts_spec.rb
vimpack-0.0.3 spec/vimpack/utils/vimscripts_spec.rb
vimpack-0.0.2 spec/vimpack/utils/vimscripts_spec.rb
vimpack-0.0.1.1 spec/vimpack/utils/vimscripts_spec.rb
vimpack-0.0.1 spec/vimpack/utils/vimscripts_spec.rb