test/unit/jkl_test.rb in jakal-0.1.7 vs test/unit/jkl_test.rb in jakal-0.1.8
- old
+ new
@@ -39,11 +39,10 @@
to be conflict within his new security team after
confirming Hillary Clinton as his choice for US Secretary of State."
EOF
tags = Jkl::Extraction::tags(key, text)
assert tags["Person"][0] == "Barack Obama"
- puts Jkl::Extraction::entities(key,text)
end
end
private
def stub_twitter
@@ -64,18 +63,14 @@
EOF
stub_request(:get, url).to_return(:body => response)
end
def stub_topix
url = YAML::load_file('config/config.yml')['topix']
- response = raw = File.open('test/fixtures/topix_rss.xml','r') do |file|
- file.readlines.to_s
- end
+ response = File.read('test/fixtures/topix_rss.xml')
stub_request(:get, "#{url}London").to_return(:body => response)
end
def stub_news_article
- response = raw = File.open('test/fixtures/bbc_story.html','r') do |file|
- file.readlines.to_s
- end
+ response = File.read('test/fixtures/bbc_story.html')
stub_request(:get, "http://www.localnews8.com/Global/story.asp?S=10876507").to_return(
:body => response
)
end
end