Sha256: 339fdf62a2edc0fd93c9a2e8b55d9c7e4ec2250ec8b01452e67a11ed7660f05f
Contents?: true
Size: 960 Bytes
Versions: 2
Compression:
Stored size: 960 Bytes
Contents
Given(/^I have a CSV with the following content:$/) do |string| @csv = string end Given(/^it is stored at the url "(.*?)"$/) do |url| @url = url content_type = @content_type || "text/csv" charset = @encoding || "UTF-8" stub_request(:get, url).to_return(:status => 200, :body => @csv, :headers => {"Content-Type" => "#{content_type}; charset=#{charset}"}) end Given(/^it is stored at the url "(.*?)" with no character set$/) do |url| @url = url content_type = @content_type || "text/csv" stub_request(:get, url).to_return(:status => 200, :body => @csv, :headers => {"Content-Type" => "#{content_type}"}) end When(/^I ask if the CSV is valid$/) do @csv_options ||= default_csv_options @validator = Csvlint::Validator.new( @url, @csv_options ) @valid = @validator.valid? end Then(/^I should get the value of true$/) do expect( @valid ).to be(true) end Then(/^I should get the value of false$/) do expect( @valid ).to be(false) end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
csvlint-0.1.0 | features/step_definitions/parse_csv_steps.rb |
csvlint-0.0.1 | features/step_definitions/parse_csv_steps.rb |