Sha256: 87c3adef3c0e65f79cf4b09d8cc3feb8c2c3eb05020d77f050b8189c6011aa0d

Contents?: true

Size: 951 Bytes

Versions: 6

Compression:

Stored size: 951 Bytes

Contents

require 'spec_helper'

describe Gush do
  describe ".gushfile" do
    let(:path) { Pathname("/tmp/Gushfile.rb") }

    context "Gushfile.rb is missing from pwd" do
      it "raises an exception" do
        path.delete if path.exist?
        Gush.configuration.gushfile = path

        expect { Gush.gushfile }.to raise_error(Errno::ENOENT)
      end
    end

    context "Gushfile.rb exists" do
      it "returns Pathname to it" do
        FileUtils.touch(path)
        Gush.configuration.gushfile = path
        expect(Gush.gushfile).to eq(path.realpath)
        path.delete
      end
    end
  end

  describe ".root" do
    it "returns root directory of Gush" do
      expected = Pathname.new(__FILE__).parent.parent
      expect(Gush.root).to eq(expected)
    end
  end

  describe ".configure" do
    it "runs block with config instance passed" do
      expect { |b| Gush.configure(&b) }.to yield_with_args(Gush.configuration)
    end
  end

end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
gush-mmx-0.4.2 spec/gush_spec.rb
gush-0.4.1 spec/gush_spec.rb
gush-0.3.3 spec/gush_spec.rb
gush-0.4 spec/gush_spec.rb
gush-0.3.2 spec/gush_spec.rb
gush-0.3.1 spec/gush_spec.rb