shark 0.0.0.5.3 → 0.0.0.5.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/Shark +58 -4
- data/lib/shark/version.rb +1 -1
- data/src/shark.rb +22 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3a20bca04b9c2e6b500c5d8563dd3229e7da978
|
4
|
+
data.tar.gz: 31ad4fc772ae26583ee44b08e151cad863cd577a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 647569185f79fecaa0e784bb49d4f1104a11b689d9bbdaed57f17cc29c368a134a81eaeef04e544aaa5fb75541a540c8ee31fa8850e50e70cd46a34b975e54ca
|
7
|
+
data.tar.gz: 17e69821779204dfbbf4185bd842253a15410a223880f6c54d4bd76613e93a49bb1ed610c20f94306dee53b928111b2f74867d05065333c074ce2f3517e1fb98
|
data/bin/Shark
CHANGED
@@ -288,7 +288,7 @@ class Shark
|
|
288
288
|
|
289
289
|
if matching_file.eql?(output_file)
|
290
290
|
|
291
|
-
|
291
|
+
test_results << true
|
292
292
|
|
293
293
|
else
|
294
294
|
|
@@ -324,11 +324,11 @@ class Shark
|
|
324
324
|
|
325
325
|
end
|
326
326
|
|
327
|
-
return output_string = output_string + detailed_fail_list
|
327
|
+
return output_string = output_string + detailed_fail_list, false
|
328
328
|
|
329
329
|
else
|
330
330
|
|
331
|
-
return "\nYour test file(s) passed the feature test.\n\n"
|
331
|
+
return "\nYour test file(s) passed the feature test.\n\n", true
|
332
332
|
|
333
333
|
end
|
334
334
|
|
@@ -422,6 +422,20 @@ class Shark
|
|
422
422
|
|
423
423
|
end
|
424
424
|
|
425
|
+
def find_file_name(input_path,file_extension)
|
426
|
+
|
427
|
+
extension_remover = input_path.split(file_extension)
|
428
|
+
|
429
|
+
remaining_string = extension_remover[0].reverse
|
430
|
+
|
431
|
+
path_finder = remaining_string.index("/")
|
432
|
+
|
433
|
+
remaining_string = remaining_string.reverse
|
434
|
+
|
435
|
+
return remaining_string[remaining_string.length-path_finder..-1]
|
436
|
+
|
437
|
+
end
|
438
|
+
|
425
439
|
list_of_features = []
|
426
440
|
|
427
441
|
Dir.foreach(@features_directory) { |x| list_of_features << @features_directory+"#{x}" }
|
@@ -432,6 +446,10 @@ class Shark
|
|
432
446
|
|
433
447
|
list_of_features = list_of_features.reject { |path| !path.include?(".feature")}
|
434
448
|
|
449
|
+
test_results = []
|
450
|
+
|
451
|
+
failed_tests = []
|
452
|
+
|
435
453
|
list_of_features.each do |feature_path|
|
436
454
|
|
437
455
|
feature_contents = read_file_line_by_line(feature_path)
|
@@ -456,7 +474,17 @@ class Shark
|
|
456
474
|
|
457
475
|
scenario[1] = scenario[1].collect{|element| element.sub("equal","$equal")}
|
458
476
|
|
459
|
-
output = parse_and_test_steps(scenario[1],@files_directory,configurations,config_values,@base_path)
|
477
|
+
output,test_result = parse_and_test_steps(scenario[1],@files_directory,configurations,config_values,@base_path)
|
478
|
+
|
479
|
+
test_results << test_result
|
480
|
+
|
481
|
+
unless test_result
|
482
|
+
|
483
|
+
puts feature_path
|
484
|
+
|
485
|
+
failed_tests << (find_file_name(feature_path,".feature") + ".feature")
|
486
|
+
|
487
|
+
end
|
460
488
|
|
461
489
|
puts output
|
462
490
|
|
@@ -466,6 +494,32 @@ class Shark
|
|
466
494
|
|
467
495
|
end
|
468
496
|
|
497
|
+
puts "Test Statistics:\n\n"
|
498
|
+
|
499
|
+
puts "Total Number of Tests: #{test_results.length}\n"
|
500
|
+
|
501
|
+
puts "Passing: #{test_results.length-failed_tests.length}\n"
|
502
|
+
|
503
|
+
unless failed_tests.empty?
|
504
|
+
|
505
|
+
puts "Failing: #{failed_tests.length}\n\n"
|
506
|
+
|
507
|
+
puts "The following feature tests failed:\n\n"
|
508
|
+
|
509
|
+
failed_tests.each do |tes|
|
510
|
+
|
511
|
+
puts tes + "\n"
|
512
|
+
|
513
|
+
end
|
514
|
+
|
515
|
+
puts "\n"
|
516
|
+
|
517
|
+
else
|
518
|
+
|
519
|
+
puts "\n\nAll of your tests passed!\n\n"
|
520
|
+
|
521
|
+
end
|
522
|
+
|
469
523
|
after_files_list = []
|
470
524
|
|
471
525
|
Dir.foreach(@files_directory) { |x| after_files_list << @files_directory+"#{x}" }
|
data/lib/shark/version.rb
CHANGED
data/src/shark.rb
CHANGED
@@ -286,7 +286,7 @@ class Shark
|
|
286
286
|
|
287
287
|
if matching_file.eql?(output_file)
|
288
288
|
|
289
|
-
|
289
|
+
test_results << true
|
290
290
|
|
291
291
|
else
|
292
292
|
|
@@ -420,6 +420,20 @@ class Shark
|
|
420
420
|
|
421
421
|
end
|
422
422
|
|
423
|
+
def find_file_name(input_path,file_extension)
|
424
|
+
|
425
|
+
extension_remover = input_path.split(file_extension)
|
426
|
+
|
427
|
+
remaining_string = extension_remover[0].reverse
|
428
|
+
|
429
|
+
path_finder = remaining_string.index("/")
|
430
|
+
|
431
|
+
remaining_string = remaining_string.reverse
|
432
|
+
|
433
|
+
return remaining_string[remaining_string.length-path_finder..-1]
|
434
|
+
|
435
|
+
end
|
436
|
+
|
423
437
|
list_of_features = []
|
424
438
|
|
425
439
|
Dir.foreach(@features_directory) { |x| list_of_features << @features_directory+"#{x}" }
|
@@ -464,7 +478,9 @@ class Shark
|
|
464
478
|
|
465
479
|
unless test_result
|
466
480
|
|
467
|
-
|
481
|
+
puts feature_path
|
482
|
+
|
483
|
+
failed_tests << (find_file_name(feature_path,".feature") + ".feature")
|
468
484
|
|
469
485
|
end
|
470
486
|
|
@@ -484,7 +500,7 @@ class Shark
|
|
484
500
|
|
485
501
|
unless failed_tests.empty?
|
486
502
|
|
487
|
-
puts "Failing: #{failed_tests.length}\n"
|
503
|
+
puts "Failing: #{failed_tests.length}\n\n"
|
488
504
|
|
489
505
|
puts "The following feature tests failed:\n\n"
|
490
506
|
|
@@ -494,9 +510,11 @@ class Shark
|
|
494
510
|
|
495
511
|
end
|
496
512
|
|
513
|
+
puts "\n"
|
514
|
+
|
497
515
|
else
|
498
516
|
|
499
|
-
puts "
|
517
|
+
puts "\n\nAll of your tests passed!\n\n"
|
500
518
|
|
501
519
|
end
|
502
520
|
|