lib/fitting/report/prefixes.rb in fitting-3.0.2 vs lib/fitting/report/prefixes.rb in fitting-4.0.0
- old
+ new
@@ -17,39 +17,25 @@
)
)
end
end
- def there_a_suitable_prefix?(test_path)
- @prefixes.map do |prefix|
- return true if prefix.name.nil?
- return true if prefix.name == ''
- return true if test_path[0..prefix.name.size - 1] == prefix.name
- end
-
- false
+ def to_a
+ @prefixes
end
- def cram_into_the_appropriate_prefix(test)
+ def find!(test)
@prefixes.map do |prefix|
- if prefix.name.nil? || prefix.name == '' || test.path[0..prefix.name.size - 1] == prefix.name
- prefix.add_test(test)
- break
+ puts test.path
+ puts test.host
+ puts test.method
+ puts test.status
+ puts test.body
+ puts prefix.name
+ if test.path[0..prefix.name.size - 1] == prefix.name
+ return prefix
end
end
- end
-
- def join(tests)
- tests.to_a.map do |test|
- if there_a_suitable_prefix?(test.path)
- cram_into_the_appropriate_prefix(test)
- test.mark_prefix
- end
- end
- end
-
- def to_a
- @prefixes
end
end
end
end