Sha256: 4507e36dba7537e1152dfacee59b3f521f6c7e4967e0be536ecdcfe0945f7b78
Contents?: true
Size: 863 Bytes
Versions: 13
Compression:
Stored size: 863 Bytes
Contents
require_relative '../spec_helper' describe Cranium::SourceRegistry do let(:registry) { Cranium::SourceRegistry.new } describe "#[]" do it "should raise an error if a source with the specified name wasn't registered yet" do expect { registry[:name] }.to raise_error "Undefined source 'name'" end end describe "#register_source" do it "should register a new source and configure it through the block passed" do source = Cranium::DSL::SourceDefinition.new :test_source source.field :test_field, String registry.register_source :test_source do field :test_field, String end expect(registry[:test_source]).to eq(source) end it "should return the newly registered source" do expect(registry.register_source(:test_source) {}).to be_a Cranium::DSL::SourceDefinition end end end
Version data entries
13 entries across 13 versions & 1 rubygems