Sha256: 7dfef578cc60347e0c551019029b5f2c9026c5d38bb71d82e065439f6c8f4e3c

Contents?: true

Size: 1.08 KB

Versions: 3

Compression:

Stored size: 1.08 KB

Contents

require 'spec_helper'
require 'guard/jasmine-headless-webkit'

describe Guard::JasmineHeadlessWebkit do
  let(:guard) { Guard::JasmineHeadlessWebkit.new([], options) }

  let(:options) { {} }

  describe "#start" do
    context 'no all on start' do
      let(:options) { { :all_on_start => false } }

      it "should not run all" do
        guard.expects(:run_all).never
        guard.start
      end
    end

    context 'all on start' do
      let(:options) { { :all_on_start => true } }

      it "should not run all" do
        guard.expects(:run_all).once
        guard.start
      end
    end
  end

  describe '#run_on_change' do
    context 'jhw call fails' do
      it "should not run all" do
        Guard::JasmineHeadlessWebkitRunner.expects(:run).returns(1)
        guard.expects(:run_all).never

        guard.run_on_change(%w{test})
      end
    end

    context 'succeed, run all' do
      it "should run all" do
        Guard::JasmineHeadlessWebkitRunner.expects(:run).returns(0)
        guard.expects(:run_all).once

        guard.run_on_change(%w{test})
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
guard-jasmine-headless-webkit-0.0.3 spec/lib/guard/jasmine-headless-webkit_spec.rb
guard-jasmine-headless-webkit-0.0.2 spec/lib/guard/jasmine-headless-webkit_spec.rb
guard-jasmine-headless-webkit-0.0.1 spec/lib/guard/jasmine-headless-webkit_spec.rb