Sha256: 94f59b54b95d0ec124f37bc090fc67bd67e67b3906c56d3780422fdff9ea37b8

Contents?: true

Size: 1.11 KB

Versions: 8

Compression:

Stored size: 1.11 KB

Contents

require 'spec_helper'

describe Sakuramochi::Configuration do
  before do
    Sakuramochi.configure do |config|
      config.clear
      @config = config
    end
  end
  subject { @config }

  describe '#configure' do
    it { should be_an_instance_of Sakuramochi::Configuration }
    its(:object_id) { should eq Sakuramochi.config.object_id }
  end

  describe '#clear' do
    before do
      @config.add :test1
      @config.add :test2
      @config.add :test3, :test4
      @config.clear
    end
    subject { @config.predicates }

    it { should be_empty }
  end

  describe '#add' do
    before do
      @config.add :test1, :grouping => true
      @config.add :test2, :grouping => false
    end
    subject { @config.predicates }

    it { should_not be_empty }

    context 'with :test1, :grouping => true' do
      it { should have_key 'test1' }
      it { should have_key 'test1_any' }
      it { should have_key 'test1_all' }
    end

    context 'with :test2, :grouping => false' do
      it { should have_key 'test2' }
      it { should_not have_key 'test2_any' }
      it { should_not have_key 'test2_all' }
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
sakuramochi-0.5.5 spec/sakuramochi/config_spec.rb
sakuramochi-0.5.4 spec/sakuramochi/config_spec.rb
sakuramochi-0.5.3 spec/sakuramochi/config_spec.rb
sakuramochi-0.5.2 spec/sakuramochi/config_spec.rb
sakuramochi-0.5.1 spec/sakuramochi/config_spec.rb
sakuramochi-0.5.0 spec/sakuramochi/config_spec.rb
sakuramochi-0.2.1 spec/sakuramochi/config_spec.rb
sakuramochi-0.1.0 spec/sakuramochi/config_spec.rb