Sha256: 86b550e2618e19d36430b6abc43da6b7e75bb34a4d5deffeeee4e37fee8f210f
Contents?: true
Size: 876 Bytes
Versions: 1
Compression:
Stored size: 876 Bytes
Contents
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 Then /^the conclusion of the committee should be a square matrix with "(\d+)" rows and columns$/ do |num| matrix = @report.conclusion matrix.row_size.should == num.to_i matrix.should be_square end 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 end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
purchase-1.0.0 | features/step_definitions/matrix.rb |