features/step_definitions/matrix.rb in purchase-1.0.0 vs features/step_definitions/matrix.rb in purchase-1.0.1

- old
+ new

@@ -1,5 +1,10 @@ +Then /^the conclusion of the committee should be a vector with "(.*)" items$/ do |count| + vector = @report.conclusion + vector.size.should == count.to_i +end + Then /^the conclusion of the committee should be a vector with value "(.*)" and position for key "(.*)"$/ do |value, key| vector = @report.conclusion position = BrighterPlanet::Purchase.key_map.index key compare_values vector[position], value end @@ -13,9 +18,7 @@ Then /^the conclusion of the committee should be a vector with values "(.*)"$/ do |column_values| column_values = column_values.split(/,/).map(&:to_f) vector = @report.conclusion vector = vector.row(0) if vector.is_a? Matrix #some vectors are single-row matrices - BrighterPlanet::Purchase.key_map.each_with_index do |key, index| - vector[index].should be_close(column_values[index].to_f, 0.00001) - end + vector.should have_column_values(column_values) end