spec/shinq/configuration_spec.rb in shinq-0.1.0 vs spec/shinq/configuration_spec.rb in shinq-0.2.0
- old
+ new
@@ -10,10 +10,11 @@
it { is_expected.to respond_to(:db_config) }
it { is_expected.to respond_to(:queue_db) }
it { is_expected.to respond_to(:default_db) }
it { is_expected.to respond_to(:process) }
it { is_expected.to respond_to(:queue_timeout) }
+ it { is_expected.to respond_to(:daemonize) }
end
describe ".new" do
context "when key does not have a accessor method" do
let(:configuration) { Shinq::Configuration.new(undefined_key_name: 'foo') }
@@ -40,12 +41,19 @@
it {expect { configuration.default_db_config }.to raise_error(Shinq::ConfigurationError)}
end
context "when default_db's config is present" do
- let(:configuration) { Shinq::Configuration.new(default_db: :test) }
+ let(:test_db_config) { {foo: :bar} }
+ let(:configuration) {
+ Shinq::Configuration.new(
+ default_db: :test,
+ db_config: {
+ test: test_db_config
+ })
+ }
- it {expect { configuration.default_db_config }.to raise_error(Shinq::ConfigurationError)}
+ it { expect(configuration.default_db_config).to be test_db_config }
end
end
describe "#db_defined?" do
context "when db_config is present" do