Sha256: 43551dd8c911db93bb8f547081cf9f3935d87603721bd4e3281e754da633a390

Contents?: true

Size: 890 Bytes

Versions: 1

Compression:

Stored size: 890 Bytes

Contents

require "helper"

describe Gasoline::Patchor do

  before do
    Gasoline::Patchor.any_instance.stubs(:save).returns(true)
    Gasoline::Patchor.any_instance.stubs(:bootstrap).returns(true)

    js = File.join(File.dirname(__FILE__), "patchor.js")
    Gasoline::Patchor.any_instance.stubs(:patchor_file).returns(js)
  end

  describe "loading patchor" do
    before do
      @patchor = Gasoline::Patchor.new
    end

    it "should load the js file into lines" do
      assert @patchor.lines.count > 1
    end

  end

  describe "patching the patch" do
    before do
      @patchor = Gasoline::Patchor.new
      drop = mock()
      drop.expects(:patch).returns("ZE PATCH")
      @patchor.expects(:drops).returns([drop])
    end

    it "should download the patches and add them to lines" do
      @patchor.patch_it_chewie
      assert @patchor.lines.include?("ZE PATCH")
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gasoline-0.0.1 test/patchor_test.rb