Sha256: baaa32521187df273ab7a13e7d636ecf19cad52b3bc457379b9cdf471ad446fb

Contents?: true

Size: 750 Bytes

Versions: 21

Compression:

Stored size: 750 Bytes

Contents

shared_examples_for 'a Dsl that utilizes ContextClass' do

  describe '#context_class_eval' do
    let(:context_class) { Class.new }
    let(:base) { described_class.new(context_class) }
    let(:the_block) { Proc.new { "Hi, I'm a block" } }
  
    it 'calls class_eval on the context_class with the given block' do
      context_class.should_receive(:class_eval).with(&the_block)
      base.context_class_eval(&the_block)
    end
  end

  describe '#context_class_name' do
    let(:context_class) { Class.new }
    let(:base) { described_class.new(context_class) }
    before { context_class.should_receive(:name).and_return('::Dog') }
  
    it 'returns the class name downcased' do
      base.context_class_name.should eq('dog')
    end
  end

end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
relish-0.7.1 spec/support/context_class_examples.rb
relish-0.7 spec/support/context_class_examples.rb
relish-0.6 spec/support/context_class_examples.rb
relish-0.5.3 spec/support/context_class_examples.rb
relish-0.5.2 spec/support/context_class_examples.rb
relish-0.5.1 spec/support/context_class_examples.rb
relish-0.5.0 spec/support/context_class_examples.rb
relish-0.4.0 spec/support/context_class_examples.rb
relish-0.3.0 spec/support/context_class_examples.rb
relish-0.3.0.pre spec/support/context_class_examples.rb
relish-0.2.3 spec/support/context_class_examples.rb
relish-0.2.2 spec/support/context_class_examples.rb
relish-0.2.1 spec/support/context_class_examples.rb
relish-0.2.0 spec/support/context_class_examples.rb
relish-0.1.6 spec/support/context_class_examples.rb
relish-0.1.5 spec/support/context_class_examples.rb
relish-0.1.4 spec/support/context_class_examples.rb
relish-0.1.3 spec/support/context_class_examples.rb
relish-0.1.2 spec/support/context_class_examples.rb
relish-0.1.1 spec/support/context_class_examples.rb