test/unit/jkl_test.rb in jakal-0.1.95 vs test/unit/jkl_test.rb in jakal-0.1.96

- old
+ new

@@ -1,13 +1,13 @@ require "test/unit" require "shoulda" require "webmock/test_unit" require "yaml" -require "lib/jkl" +require_relative "../../lib/jkl" class JklTest < Test::Unit::TestCase - include WebMock + include WebMock::API context "Using Jkl" do setup do stub_twitter stub_topix @@ -31,10 +31,12 @@ text = Jkl::Text::sanitize(Jkl::get_from(articles[0])) assert_not_nil text end should "extract tags from some text" do - key = YAML::load_file('config/keys.yml')['calais'] + keys = "config/keys.yml" + raise "READ:::::::: You need to create #{keys} and put your calais credentials in it." unless File.exist?(keys) + key = YAML::load_file(keys)['calais'] text = <<-EOF Barack Obama said today that he expects there to be conflict within his new security team after confirming Hillary Clinton as his choice for US Secretary of State." EOF