module JSON::SchemaBuilder::RSpecHelper::ClassMethods

Public Instance Methods

with(key, &block) click to toggle source
# File lib/json/schema_builder/rspec_helper/rspec_helper.rb, line 34
def with(key, &block)
  describe ".#{ key }" do
    eval "def subject; super.#{ key }; end"

    it 'should return an entity' do
      expect(schema).to be_a JSON::SchemaBuilder::Entity
    end

    instance_exec &block
  end
end