Sha256: 1385e9318cdcbca998acc6da29d3e2d6b35f32cccf6072ff4510d70daf979f5a
Contents?: true
Size: 1.23 KB
Versions: 5
Compression:
Stored size: 1.23 KB
Contents
When /^I post some data to yahoo$/ do @url = URI.parse('http://search.yahooapis.com/ContentAnalysisService/V1/termExtraction') appid = LICENSE_ID = YAML::load_file('config/keys.yml')['yahoo'] context = URI.encode('Italian sculptors and painters of the renaissance favored the Virgin Mary for inspiration') post_args = { 'appid' => appid, 'context' => context, 'output' => 'json' } @response = Jkl::post_to @url, post_args end Given /^I have some RSS$/ do raw = File.open('features/mocks/topix_rss.xml','r') {|f| f.readlines.to_s} @response = Hpricot.XML raw end When /^I make a restful get request$/ do url = "http://news.bbc.co.uk/1/hi/uk_politics/7677419.stm" @response = Jkl::get_from url end When /^I request some twitter trends$/ do twitter_json_url = YAML::load_file('config/config.yml')['twitter'] output = JSON.parse Jkl::get_from twitter_json_url @response = output['trends'] end Then /^I should get a response$/ do @response.should_not == nil end Then /^I should be able to get the copy from the first headline$/ do @response = Jkl::get_from @links[0] @response.should_not be_nil @response.should_not == "" @text = Jkl::sanitize @response end Then /^I should see some text$/ do @response.length.should > 0 end
Version data entries
5 entries across 5 versions & 1 rubygems