spec/scanner_spec.rb in rock_config-0.0.0 vs spec/scanner_spec.rb in rock_config-0.0.1

- old
+ new

@@ -1,23 +1,26 @@ require "spec_helper" module RockConfig describe Scanner do - it "finds nothing when the target doesnt exist" do + let(:configuration) do configuration = Configuration.new - scanner = Scanner.new(configuration) + configuration.scanned_directories << File.join(Dir.pwd, "config") + configuration.config_loaders << YamlLoader.new + configuration + end - scanner.find("database").should be_nil + let(:scanner) { Scanner.new(configuration) } + let(:fixtures_path) { File.join(Dir.pwd, "spec", "fixtures") } + + it "finds nothing when the target doesnt exist" do + expect do + scanner.find("database") + end.to raise_error(ConfigNotFound) end it "scans additional directories" do - fixtures_path = File.join(Dir.pwd, "spec", "fixtures") - - configuration = Configuration.new configuration.scanned_directories << fixtures_path - - scanner = Scanner.new(configuration) - scanner.find("database").should_not be_nil end end end