Sha256: 18b4d42c9c9fd68b8bb4e58efd02f4478cac177a70ba25a7cf860a5726fb0d8b

Contents?: true

Size: 846 Bytes

Versions: 8

Compression:

Stored size: 846 Bytes

Contents

describe Odania::Config::PluginConfig do
	let(:cfg) {
		JSON.parse File.read("#{BASE_DIR}/spec/fixtures/plugin_config_1.json")
	}

	context 'configuration' do
		it 'should be valid' do
			expect(subject.config).to be_a(Hash)
			expect(subject.domains).to be_a(Hash)
			subject.domains.each_pair do |domain, data|
				expect(data).to be_a(Odania::Config::Domain)
			end
		end

		it 'loads configuration' do
			expect(subject.load(cfg)).to be(true)

			expect(subject.config).to eql(cfg['config'])
			expect(subject.plugin_config).to eql(cfg['plugin-config'])
			expect(subject.domains.keys).to eql(cfg['domains'].keys)
		end

		it 'dumps the same config' do
			expect(subject.load(cfg)).to be(true)
			result = subject.dump
			diff = HashDiff.best_diff result, cfg
			puts "Best diff: #{diff.inspect}"
			expect(result).to eql(cfg)
		end
	end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
odania-0.1.0 spec/lib/odania/config/plugin_config_spec.rb
odania-0.0.39 spec/lib/odania/config/plugin_config_spec.rb
odania-0.0.38 spec/lib/odania/config/plugin_config_spec.rb
odania-0.0.37 spec/lib/odania/config/plugin_config_spec.rb
odania-0.0.36 spec/lib/odania/config/plugin_config_spec.rb
odania-0.0.35 spec/lib/odania/config/plugin_config_spec.rb
odania-0.0.34 spec/lib/odania/config/plugin_config_spec.rb
odania-0.0.33 spec/lib/odania/config/plugin_config_spec.rb