Sha256: b51598359e88fe6b8f9ba84ae2f81127dcc6c3a4fb4503a7fb488c613ea90bea

Contents?: true

Size: 1.27 KB

Versions: 14

Compression:

Stored size: 1.27 KB

Contents

Given(/^I have a schema with the following content:$/) do |json|
  @schema_type = :json_table
  @schema_json = json
end

Given(/^I have metadata with the following content:$/) do |json|
  @schema_type = :csvw_metadata
  @schema_json = json
end

Given(/^I have a metadata file called "([^"]*)"$/) do |filename|
  @schema_type = :csvw_metadata
  @schema_json = File.read( File.join( File.dirname(__FILE__), "..", "fixtures", filename ) )
end

Given(/^the (schema|metadata) is stored at the url "(.*?)"$/) do |schema_type,schema_url|
  @schema_url = schema_url
  stub_request(:get, @schema_url).to_return(:status => 200, :body => @schema_json.to_str)
end

Given(/^there is a file at "(.*?)" with the content:$/) do |url, content|
  stub_request(:get, url).to_return(:status => 200, :body => content.to_str)
end

Given(/^I have a file called "(.*?)" at the url "(.*?)"$/) do |filename,url|
  content = File.read( File.join( File.dirname(__FILE__), "..", "fixtures", filename ) )
  content_type = filename =~ /.csv$/ ? "text/csv" : "application/csvm+json"
  stub_request(:get, url).to_return(:status => 200, :body => content, :headers => {"Content-Type" => "#{content_type}; charset=UTF-8"})
end

Given(/^there is no file at the url "(.*?)"$/) do |url|
  stub_request(:get, url).to_return(:status => 404)
end

Version data entries

14 entries across 14 versions & 3 rubygems

Version Path
csvlint-1.0.0 features/step_definitions/schema_validation_steps.rb
csvlint-0.4.0 features/step_definitions/schema_validation_steps.rb
csvlint-0.3.3 features/step_definitions/schema_validation_steps.rb
csvlint-0.3.2 features/step_definitions/schema_validation_steps.rb
csvlint-0.3.1 features/step_definitions/schema_validation_steps.rb
csvlint-0.3.0 features/step_definitions/schema_validation_steps.rb
wjordan213-csvlint-0.2.8 features/step_definitions/schema_validation_steps.rb
wjordan213.csvlint-0.2.8 features/step_definitions/schema_validation_steps.rb
csvlint-0.2.6 features/step_definitions/schema_validation_steps.rb
csvlint-0.2.5 features/step_definitions/schema_validation_steps.rb
csvlint-0.2.4 features/step_definitions/schema_validation_steps.rb
csvlint-0.2.2 features/step_definitions/schema_validation_steps.rb
csvlint-0.2.1 features/step_definitions/schema_validation_steps.rb
csvlint-0.2.0 features/step_definitions/schema_validation_steps.rb