Sha256: 7d183122ed9f9437ee6953350cc271c41c974341e560d88554f548c4c4c81c0f

Contents?: true

Size: 1.15 KB

Versions: 1

Compression:

Stored size: 1.15 KB

Contents

require 'spec_helper'

describe "Belajar module" do

  describe "::config" do

    subject { Belajar.config }

    [:config, :configure, :start].each do |method|
      it "responds to ::#{method}" do
        expect(Belajar.singleton_methods).to include method
      end
    end

    it "returns Configuration of class Belajar::Configuration" do
      expect(subject).to be_an_instance_of Belajar::Configuration
    end

    it "returns a singleton setting" do
      expect(subject).to be Belajar.config
    end
  end

  describe "::configure" do

    let(:configure) do
      proc do
        Belajar.configure do |config|
          config.solutions_path = test_basepath
        end
      end
    end

    it "allows to configure the app" do
      expect { configure.call }.not_to raise_error
    end

    it "sets configutation properties" do
      configure.call
      expect(Belajar.config.solutions_path).to eq test_basepath
    end

    it "allows to change the config during runtime" do
      Belajar.configure do |config|
        config.solutions_path = courses_basepath
      end

      expect(Belajar.config.solutions_path).to eq courses_basepath
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
belajar-0.1.1 spec/belajar_spec.rb