Skip to content

Instantly share code, notes, and snippets.

@HeroicEric
Created October 3, 2011 18:36
Show Gist options
  • Save HeroicEric/1259863 to your computer and use it in GitHub Desktop.
Save HeroicEric/1259863 to your computer and use it in GitHub Desktop.
require 'spec_helper'
describe VariantDatasheet do
describe "Importing Data" do
it "should parse file contents and return a result" do
variant_datasheet = VariantDatasheet.new
file_path = 'spec/support/toughbook_19_variants.csv'
# Result should be an array of arrays
result = [
["TYPE", "FAMILY", "SKU", "DESCRIPTION"," SRP ", "STATUS", "CPU", "SCREEN", "RAM", "BASE SKU", "HDD", "WLAN/WWLAN", "DRIVE", "OS", "WIRELESS CARRIER", "OTHER", "LAST MODIFIED", "COMMENT", "Effective Date"],
["CPU", "CF-19", "CF-19BTUDX1M","No Wireless\, Win7\, Intel Core i5-2520M 2.50GHz\, No vPro\, 10.1\" TF+XGA Touch\, 320GB(7200rpm)\, 4GB\, No WLAN\, TPM\, No Bluetooth\, Dual Pass (Upper:WWAN/Lower:None)\, Smartcard\, No Absolute BIOS\, No Drive\, Toughbook Preferred", 3859, "CURRENT", "Intel Core i5-2520M 2.50GHz", "10.1"" TF+XGA Touch", "4GB", "F", "320GB(7200rpm)", "No WLAN", "No Drive", "Win7", "No WLAN", "No Bluetooth\, Dual Pass (Upper:WWAN/Lower:None)\, Smartcard", "8/26/11 17:33" , nil, nil]
]
variant_datasheet.import_data(file_path).should eq(result)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment