Sha256: ccb781e9faeef2169721df236f2fe2eeb853c67d548a67e9f3f71910c9636ddf

Contents?: true

Size: 902 Bytes

Versions: 5

Compression:

Stored size: 902 Bytes

Contents

require 'spec_helper'

describe Sakuramochi::Configuration do
  before do
    Sakuramochi.configure do |config|
      @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 '#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

5 entries across 5 versions & 1 rubygems

Version Path
sakuramochi-0.6.0 spec/sakuramochi/config_spec.rb
sakuramochi-0.5.9 spec/sakuramochi/config_spec.rb
sakuramochi-0.5.8 spec/sakuramochi/config_spec.rb
sakuramochi-0.5.7 spec/sakuramochi/config_spec.rb
sakuramochi-0.5.6 spec/sakuramochi/config_spec.rb