Sha256: 3fe19f08fe9787fa255c6a596e408a757aee49e4ad59121637af050f74f3425b

Contents?: true

Size: 1.24 KB

Versions: 1

Compression:

Stored size: 1.24 KB

Contents

require 'hodor/environment'

module Hodor

  describe Environment do

    describe "Required Public Interface" do

      # .instance instead of .new necessitated by singleton:
      subject(:hadoop_env) { Hodor::Environment.instance_methods }

      # Public fields
      it { should include :logger }

      # Public methods
      it { should include :erb_sub }
      it { should include :erb_load }
      it { should include :yml_load }
      it { should include :root }
    end

    describe "Ensure usable test repo" do

      # .instance instead of .new necessitated by singleton:
      subject(:env) { Hodor::Environment.instance }

      it "should have correct root" do
        expect(subject.root).to match(/spec\/test_repo/)
      end
    end

    context "Test basic environment methods" do

      subject(:env) { Hodor::Environment.instance }

      before(:each) do
        use_settings hdfs_root: "/", hdfs_user: "hdfs"
        use_pwd "drivers/testbench"
      end

      it "should fail if no jobs.yml file exists" do
        expect(
          env.paths_from_root(Dir.pwd)
        ).to match_array(
          [/spec\/test_repo/,
           /spec\/test_repo\/drivers/,
           /spec\/test_repo\/drivers\/testbench/]
        )
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hodor-1.0.2 spec/unit/hodor/environment_spec.rb