spec/plow/dependencies_spec.rb in plow-1.0.0 vs spec/plow/dependencies_spec.rb in plow-1.0.1

- old
+ new

@@ -10,14 +10,14 @@ Plow::Dependencies::REQUIRED_RUBY_VERSION.should == '1.9.1' end it "development gem names and versions should be correct" do expected = { - :jeweler => '1.3.0', - :rspec => '1.2.9', - :yard => '0.4.0', - :bluecloth => '2.0.5' + :jeweler => '1.4.0', + :rspec => '1.3.0', + :yard => '0.5.3', + :bluecloth => '2.0.7' } Plow::Dependencies::DEVELOPMENT_GEMS.should == expected end @@ -51,31 +51,31 @@ ERROR end it "should abort for ruby 1.8.6" do version = '1.8.6' - lambda { Plow::Dependencies.send(:check_ruby_version, version) }.should raise_error(SystemExit, expected_message(version)) + lambda { Plow::Dependencies.send(:check_ruby_version, version) }.should raise_exception(SystemExit, expected_message(version)) end it "should abort for ruby 1.8.7" do version = '1.8.7' - lambda { Plow::Dependencies.send(:check_ruby_version, version) }.should raise_error(SystemExit, expected_message(version)) + lambda { Plow::Dependencies.send(:check_ruby_version, version) }.should raise_exception(SystemExit, expected_message(version)) end it "should abort for ruby 1.9.0" do version = '1.9.0' - lambda { Plow::Dependencies.send(:check_ruby_version, version) }.should raise_error(SystemExit, expected_message(version)) + lambda { Plow::Dependencies.send(:check_ruby_version, version) }.should raise_exception(SystemExit, expected_message(version)) end it "should not abort for ruby 1.9.1" do version = '1.9.1' - lambda { Plow::Dependencies.send(:check_ruby_version, version) }.should_not raise_error(SystemExit, expected_message(version)) + lambda { Plow::Dependencies.send(:check_ruby_version, version) }.should_not raise_exception(SystemExit, expected_message(version)) end it "should abort for ruby 1.9.2" do version = '1.9.2' - lambda { Plow::Dependencies.send(:check_ruby_version, version) }.should raise_error(SystemExit, expected_message(version)) + lambda { Plow::Dependencies.send(:check_ruby_version, version) }.should raise_exception(SystemExit, expected_message(version)) end end ################################################################################################## @@ -98,11 +98,11 @@ Plow::Dependencies.destroy_warnings end it "should create and cache one warning from a known development gem dependency" do Plow::Dependencies.create_warning_for(LoadError.new("no such file to load -- jeweler")) - Plow::Dependencies.class_variable_get(:@@warnings_cache).should == ["jeweler --version '1.3.0'"] + Plow::Dependencies.class_variable_get(:@@warnings_cache).should == ["jeweler --version '1.4.0'"] end it "should create and cache warnings from all known development gem dependencies" do Plow::Dependencies::DEVELOPMENT_GEMS.each_key do |file_name| gem_name = if Plow::Dependencies::FILE_NAME_TO_GEM_NAME.has_key?(file_name) @@ -113,20 +113,20 @@ load_error = LoadError.new("no such file to load -- #{gem_name}") Plow::Dependencies.create_warning_for(load_error) end expected = [ - "jeweler --version '1.3.0'", - "rspec --version '1.2.9'", - "yard --version '0.4.0'", - "bluecloth --version '2.0.5'" + "jeweler --version '1.4.0'", + "rspec --version '1.3.0'", + "yard --version '0.5.3'", + "bluecloth --version '2.0.7'" ] Plow::Dependencies.class_variable_get(:@@warnings_cache).should == expected end it "should raise an exception when creating a warning from an unknown development gem dependency" do - lambda { Plow::Dependencies.create_warning_for(LoadError.new("no such file to load -- _fakegem")) }.should raise_error(RuntimeError, "Cannot create a dependency warning for unknown development gem -- _fakegem") + lambda { Plow::Dependencies.create_warning_for(LoadError.new("no such file to load -- _fakegem")) }.should raise_exception(RuntimeError, "Cannot create a dependency warning for unknown development gem -- _fakegem") end end ################################################################################################## @@ -146,13 +146,13 @@ Plow::Dependencies.create_warning_for(LoadError.new("no such file to load -- bluecloth")) Plow::Dependencies.render_warnings $stdout.string.should == <<-MESSAGE The following development gem dependencies could not be found. Without them, some available development features are missing: -jeweler --version '1.3.0' -rspec --version '1.2.9' -yard --version '0.4.0' -bluecloth --version '2.0.5' +jeweler --version '1.4.0' +rspec --version '1.3.0' +yard --version '0.5.3' +bluecloth --version '2.0.7' MESSAGE end it "should not display a warning message to the user if there are no warnings in the cache" do Plow::Dependencies.destroy_warnings