Sha256: 4560c605adf9d051df40d87a01adc6d790f5fee68454d6a6406d1b396755f63f

Contents?: true

Size: 910 Bytes

Versions: 1

Compression:

Stored size: 910 Bytes

Contents

require "spec_helper"
require "teaspoon/console"

describe Guard::Teaspoon::Resolver do

  describe "#initialize" do

    it "assigns options" do
      options = {foo: "bar"}
      subject = Guard::Teaspoon::Resolver.new(options)
      expect(subject.instance_variable_get(:@options)).to be(options)
    end

  end

  describe "#resolve" do

    it "calls through to Teaspoon::Suite to resolve paths and assigns them to suites" do
      Teaspoon::Suite.should_receive(:resolve_spec_for).with("foo").and_return(suite: "default", path: "foo")
      Teaspoon::Suite.should_receive(:resolve_spec_for).with("bar").and_return(suite: "default", path: "bar")
      Teaspoon::Suite.should_receive(:resolve_spec_for).with("baz").and_return(suite: "other", path: "baz")
      subject.resolve(["foo", "bar", "baz"])
      expect(subject.suites).to eq({"default" => ["foo", "bar"], "other" => ["baz"]})
    end

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
guard-teaspoon-0.0.3 spec/guard/teaspoon/resolver_spec.rb