Sha256: f83018fe74afec02803479f900e942aeb4137914e7ecafc092d772247450acc9

Contents?: true

Size: 896 Bytes

Versions: 2

Compression:

Stored size: 896 Bytes

Contents

require "spec_helper"
require "teabag/console"

describe Guard::Teabag::Resolver do

  describe "#initialize" do

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

  end

  describe "#resolve" do

    it "calls through to Teabag::Suite to resolve paths and assigns them to suites" do
      Teabag::Suite.should_receive(:resolve_spec_for).with("foo").and_return(suite: "default", path: "foo")
      Teabag::Suite.should_receive(:resolve_spec_for).with("bar").and_return(suite: "default", path: "bar")
      Teabag::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

2 entries across 2 versions & 1 rubygems

Version Path
guard-teabag-0.0.2 spec/guard/teabag/resolver_spec.rb
guard-teabag-0.0.1 spec/guard/teabag/resolver_spec.rb