+{
+ my @added;
+
+ my $fh = File::Temp->new;
+ my $filename = $fh->filename;
+
+ print $fh <<EOS;
+test$when,"Test product option import $when","Colour","Red|Green|Blue","0|100|0",100
+EOS
+ close $fh;
+ my $imp = BSE::Importer->new(cfg => $cfg, profile => "withoption$when",
+ callback => sub { note @_ });
+ $imp->process($filename);
+
+ is_deeply([ $imp->errors ], [], "check no errors");
+
+ @added = sort { $a->title cmp $b->title } $imp->leaves;
+ is(@added, 1, "Only added one");
+ my $one = $added[0];
+ is($one->title, "Test product option import $when", "check the title is set");
+ my @options = $one->db_options;
+ is(@options, 1, "should be one option");
+ is($options[0]->name, "Colour", "name of option");
+ my @values = $options[0]->values;
+ is(@values, 3, "should be three options");
+ is($values[0]->value, "Red", "first value text correct");
+ is($values[1]->get_custom("value_price"), "100", "second custom field correct");
+
+ END {
+ $_->remove($cfg) for @added;
+ }
+}
+