Sha256: 8ff4a76e93be4fe5e0da6638a9835c379adff07f8c2d85fb83e99113c49efedf

Contents?: true

Size: 1.17 KB

Versions: 2

Compression:

Stored size: 1.17 KB

Contents

Given /^I have some simple text$/ do
  @text = "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."
end

Given /^I have a sanitized sample BBC story$/ do
  Given "I have a sample BBC story"
	When "I sanitize this text"
end

Given /^I have a mock calais response$/ do
  @response = File.open('features/mocks/calais.json','r') {|f| f.readlines.to_s}
end

When /^I post to calais$/ do
  @response = get_from_calais @text
end

When /^I remove the unwanted items$/ do
  @processed_json = clean_unwanted_items_from_hash(JSON.parse(@response))
end

Then /^there should no longer be any "([^\"]*)"$/ do |arg1|
  @processed_json[arg1].should be_nil
end

Then /^I should receive some tags$/ do
  get_tag_from_json(@response) do |tag| 
    tag.should_not be_nil
  end
end

Then /^there should be some "([^\"]*)" tags$/ do |arg1|
  get_tag_from_json(@response) {|tag|
    #puts tag.inspect
    tag.each{|k,v| puts "#{k} : #{v}" if k=='_type'}
  }
end

Then /^I should be able to see the whole lot of tags as one block$/ do
  tags = get_tag_from_json(@response)
  tags.length.should > 0
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sshingler-jkl-0.0.5 features/step_definitions/calais_steps.rb
sshingler-jkl-0.0.6 features/step_definitions/calais_steps.rb