From 4369987bc19c6a9516d1bfba2f7ac129da661ba5 Mon Sep 17 00:00:00 2001 From: giulianobelinassi Date: Fri, 23 Jun 2017 14:33:36 -0300 Subject: [PATCH] Read files once per test in global_test Signed-off-by: Giuliano Belinassi Signed-off-by: Lucas Kanashiro Signed-off-by: Bruno Sesso --- spec/language/ruby/global_test/blocks/simple_blocks_spec.rb | 6 +++--- .../ruby/global_test/complete_class_ruby_O1_spec.rb | 6 +++--- spec/language/ruby/global_test/complete_class_ruby_spec.rb | 6 +++--- .../global_test/conditional/a_lot_of_conditionals_spec.rb | 6 +++--- .../conditional/constructor_very_mix_conditional_spec.rb | 6 +++--- .../conditional/function_with_conditional_spec.rb | 6 +++--- .../conditional/function_with_nested_conditional_spec.rb | 6 +++--- .../conditional/method_very_mix_conditional_spec.rb | 6 +++--- .../global_test/conditional/single_line_conditional_spec.rb | 6 +++--- .../conditional/very_deep_conditional_structure_spec.rb | 6 +++--- .../global_test/conditional/very_mix_conditional_spec.rb | 6 +++--- .../mix_conditional_repetition_spec.rb | 6 +++--- .../global_test/constructor/different_constructors_spec.rb | 6 +++--- .../global_test/global_variable/global_variable_spec.rb | 6 +++--- .../ruby/global_test/repetition/complete_class_integrity.rb | 2 +- .../repetition/complete_class_until_loop_spec.rb | 6 +++--- .../repetition/complete_class_while_loop_spec.rb | 6 +++--- .../repetition/complete_class_with_repetition_spec.rb | 6 +++--- .../repetition/constructor_with_mix_repetition_spec.rb | 6 +++--- .../repetition/method_with_mix_repetition_spec.rb | 6 +++--- .../ruby/global_test/repetition/very_mix_repetition_spec.rb | 6 +++--- .../global_test/repetition/very_nested_repetition_spec.rb | 6 +++--- .../troublemakers/global_variable_spec_sample.rb | 6 +++--- 23 files changed, 67 insertions(+), 67 deletions(-) diff --git a/spec/language/ruby/global_test/blocks/simple_blocks_spec.rb b/spec/language/ruby/global_test/blocks/simple_blocks_spec.rb index ea5fa48..58aec59 100644 --- a/spec/language/ruby/global_test/blocks/simple_blocks_spec.rb +++ b/spec/language/ruby/global_test/blocks/simple_blocks_spec.rb @@ -2,7 +2,7 @@ RSpec.describe 'Simple blocks as a script' do - before :each do + before :all do @path = './spec/language/ruby/global_test/blocks/.kuniri.yml' @kuniri = Kuniri::Kuniri.new @kuniri.read_configuration_file(@path) @@ -10,7 +10,7 @@ parser = Parser::XMLOutputFormat.new(0, @kuniri.configurationInfo[:output]) parser.create_all_data(@kuniri.get_parser()) target = './spec/language/ruby/global_test/blocks/simple_block_script.xml' - @output = File.open(target, 'r') + @output = File.open(target, 'r').read.split("\n") end RSpec.shared_examples 'Block verification' do |regex, description| @@ -46,7 +46,7 @@ end - after :each do + after :all do @kuniri = nil @output = nil end diff --git a/spec/language/ruby/global_test/complete_class_ruby_O1_spec.rb b/spec/language/ruby/global_test/complete_class_ruby_O1_spec.rb index 966015a..7dc53d0 100644 --- a/spec/language/ruby/global_test/complete_class_ruby_O1_spec.rb +++ b/spec/language/ruby/global_test/complete_class_ruby_O1_spec.rb @@ -2,14 +2,14 @@ RSpec.describe 'Reduced size (o1)' do - before :each do + before :all do @path = './spec/language/ruby/global_test/.kuniri.yml' @kuniri = Kuniri::Kuniri.new @kuniri.read_configuration_file(@path) @kuniri.run_analysis parser = Parser::XMLOutputFormat.new(1, @kuniri.configurationInfo[:output]) parser.create_all_data(@kuniri.get_parser()) - @output = File.open('./spec/language/ruby/global_test/simpleFullCode.xml', 'r') + @output = File.open('./spec/language/ruby/global_test/simpleFullCode.xml', 'r').read.split("\n") end it 'Should contain the class name' do @@ -189,7 +189,7 @@ end - after :each do + after :all do @kuniri = nil @output = nil end diff --git a/spec/language/ruby/global_test/complete_class_ruby_spec.rb b/spec/language/ruby/global_test/complete_class_ruby_spec.rb index 01216af..84f4262 100644 --- a/spec/language/ruby/global_test/complete_class_ruby_spec.rb +++ b/spec/language/ruby/global_test/complete_class_ruby_spec.rb @@ -2,14 +2,14 @@ RSpec.describe Kuniri::Kuniri do - before :each do + before :all do @path = "./spec/language/ruby/global_test/.kuniri.yml" @kuniri = Kuniri::Kuniri.new @kuniri.read_configuration_file(@path) @kuniri.run_analysis parser = Parser::XMLOutputFormat.new(0, @kuniri.configurationInfo[:output]) parser.create_all_data(@kuniri.get_parser()) - @output = File.open("./spec/language/ruby/global_test/simpleFullCode.xml", "r") + @output = File.open("./spec/language/ruby/global_test/simpleFullCode.xml", "r").read.split("\n") end it "Should contain the class name" do @@ -190,7 +190,7 @@ end - after :each do + after :all do @kuniri = nil @output = nil end diff --git a/spec/language/ruby/global_test/conditional/a_lot_of_conditionals_spec.rb b/spec/language/ruby/global_test/conditional/a_lot_of_conditionals_spec.rb index 1d21706..bb85db6 100644 --- a/spec/language/ruby/global_test/conditional/a_lot_of_conditionals_spec.rb +++ b/spec/language/ruby/global_test/conditional/a_lot_of_conditionals_spec.rb @@ -2,7 +2,7 @@ RSpec.describe Kuniri::Kuniri do - before :each do + before :all do @path = "./spec/language/ruby/global_test/conditional/.kuniri2.yml" @kuniri = Kuniri::Kuniri.new @kuniri.read_configuration_file(@path) @@ -10,7 +10,7 @@ parser = Parser::XMLOutputFormat.new(0, @kuniri.configurationInfo[:output]) parser.create_all_data(@kuniri.get_parser()) str = "./spec/language/ruby/global_test/conditional/aLotOfConditionals.xml" - @output = File.open(str, "r") + @output = File.open(str, "r").read.split("\n") end RSpec.shared_examples "Conditional verification" do |regex, description| @@ -84,7 +84,7 @@ end - after :each do + after :all do @kuniri = nil @output1 = nil end diff --git a/spec/language/ruby/global_test/conditional/constructor_very_mix_conditional_spec.rb b/spec/language/ruby/global_test/conditional/constructor_very_mix_conditional_spec.rb index 0b7b615..6e8de13 100644 --- a/spec/language/ruby/global_test/conditional/constructor_very_mix_conditional_spec.rb +++ b/spec/language/ruby/global_test/conditional/constructor_very_mix_conditional_spec.rb @@ -2,7 +2,7 @@ RSpec.describe 'Very mixed conditional inside constructor' do - before :each do + before :all do @path = './spec/language/ruby/global_test/conditional/.kuniri5.yml' @kuniri = Kuniri::Kuniri.new @kuniri.read_configuration_file(@path) @@ -11,7 +11,7 @@ parser.create_all_data(@kuniri.get_parser()) target = './spec/language/ruby/global_test/conditional/' << 'constructorVeryMixConditional.xml' - @output = File.open(target, 'r') + @output = File.open(target, 'r').read.split("\n") end RSpec.shared_examples 'Constructor with conditional' do |regex, description| @@ -97,7 +97,7 @@ end - after :each do + after :all do @kuniri = nil @output = nil end diff --git a/spec/language/ruby/global_test/conditional/function_with_conditional_spec.rb b/spec/language/ruby/global_test/conditional/function_with_conditional_spec.rb index fccd593..a3f4141 100644 --- a/spec/language/ruby/global_test/conditional/function_with_conditional_spec.rb +++ b/spec/language/ruby/global_test/conditional/function_with_conditional_spec.rb @@ -2,7 +2,7 @@ RSpec.describe Kuniri::Kuniri do - before :each do + before :all do @path = "./spec/language/ruby/global_test/conditional/.kuniri.yml" @kuniri = Kuniri::Kuniri.new @kuniri.read_configuration_file(@path) @@ -10,7 +10,7 @@ parser = Parser::XMLOutputFormat.new(0, @kuniri.configurationInfo[:output]) parser.create_all_data(@kuniri.get_parser()) target = "./spec/language/ruby/global_test/conditional/output.xml" - @output = File.open(target, "r") + @output = File.open(target, "r").read.split("\n") end RSpec.shared_examples "Function with conditional" do |regex, description| @@ -86,7 +86,7 @@ end end - after :each do + after :all do @kuniri = nil @output = nil end diff --git a/spec/language/ruby/global_test/conditional/function_with_nested_conditional_spec.rb b/spec/language/ruby/global_test/conditional/function_with_nested_conditional_spec.rb index c5aef31..fcc75ce 100644 --- a/spec/language/ruby/global_test/conditional/function_with_nested_conditional_spec.rb +++ b/spec/language/ruby/global_test/conditional/function_with_nested_conditional_spec.rb @@ -2,7 +2,7 @@ RSpec.describe Kuniri::Kuniri do - before :each do + before :all do @path = "./spec/language/ruby/global_test/conditional/.kuniri1.yml" @kuniri = Kuniri::Kuniri.new @kuniri.read_configuration_file(@path) @@ -10,7 +10,7 @@ parser = Parser::XMLOutputFormat.new(0, @kuniri.configurationInfo[:output]) parser.create_all_data(@kuniri.get_parser()) target = "./spec/language/ruby/global_test/conditional/output1.xml" - @output = File.open(target, "r") + @output = File.open(target, "r").read.split("\n") end RSpec.shared_examples "Nested conditional" do |regex, description| @@ -48,7 +48,7 @@ end - after :each do + after :all do @kuniri = nil @output = nil end diff --git a/spec/language/ruby/global_test/conditional/method_very_mix_conditional_spec.rb b/spec/language/ruby/global_test/conditional/method_very_mix_conditional_spec.rb index fc497ff..e8f2e37 100644 --- a/spec/language/ruby/global_test/conditional/method_very_mix_conditional_spec.rb +++ b/spec/language/ruby/global_test/conditional/method_very_mix_conditional_spec.rb @@ -2,7 +2,7 @@ RSpec.describe Kuniri::Kuniri do - before :each do + before :all do @path = "./spec/language/ruby/global_test/conditional/.kuniri6.yml" @kuniri = Kuniri::Kuniri.new @kuniri.read_configuration_file(@path) @@ -11,7 +11,7 @@ parser.create_all_data(@kuniri.get_parser()) target = "./spec/language/ruby/global_test/conditional/" + "methodVeryMixConditional.xml" - @output = File.open(target, "r") + @output = File.open(target, "r").read.split("\n") end RSpec.shared_examples "Method with mix conditional" do |regex, description| @@ -101,7 +101,7 @@ end - after :each do + after :all do @kuniri = nil @output = nil end diff --git a/spec/language/ruby/global_test/conditional/single_line_conditional_spec.rb b/spec/language/ruby/global_test/conditional/single_line_conditional_spec.rb index a1e3a9d..7151791 100644 --- a/spec/language/ruby/global_test/conditional/single_line_conditional_spec.rb +++ b/spec/language/ruby/global_test/conditional/single_line_conditional_spec.rb @@ -2,7 +2,7 @@ RSpec.describe Kuniri::Kuniri do - before :each do + before :all do @path = './spec/language/ruby/global_test/conditional/.kuniri7.yml' @kuniri = Kuniri::Kuniri.new @kuniri.read_configuration_file(@path) @@ -10,7 +10,7 @@ parser = Parser::XMLOutputFormat.new(0, @kuniri.configurationInfo[:output]) parser.create_all_data(@kuniri.get_parser()) target = './spec/language/ruby/global_test/conditional/output7.xml' - @output = File.open(target, 'r') + @output = File.open(target, 'r').read.split("\n") end RSpec.shared_examples 'Single line' do |regex, description| @@ -70,7 +70,7 @@ end end - after :each do + after :all do @kuniri = nil @output = nil end diff --git a/spec/language/ruby/global_test/conditional/very_deep_conditional_structure_spec.rb b/spec/language/ruby/global_test/conditional/very_deep_conditional_structure_spec.rb index 2eff7ef..0a8d096 100644 --- a/spec/language/ruby/global_test/conditional/very_deep_conditional_structure_spec.rb +++ b/spec/language/ruby/global_test/conditional/very_deep_conditional_structure_spec.rb @@ -2,7 +2,7 @@ RSpec.describe 'Very deep conditional structure' do - before :each do + before :all do @path = './spec/language/ruby/global_test/conditional/.kuniri3.yml' @kuniri = Kuniri::Kuniri.new @kuniri.read_configuration_file(@path) @@ -11,7 +11,7 @@ parser.create_all_data(@kuniri.get_parser()) target = './spec/language/ruby/global_test/conditional/' + 'veryDeepConditionalStructure.xml' - @output = File.open(target, 'r') + @output = File.open(target, 'r').read.split("\n") end RSpec.shared_examples 'Deep conditional' do |regex, description| @@ -53,7 +53,7 @@ end - after :each do + after :all do @kuniri = nil @output = nil end diff --git a/spec/language/ruby/global_test/conditional/very_mix_conditional_spec.rb b/spec/language/ruby/global_test/conditional/very_mix_conditional_spec.rb index 2dff16d..cd921ef 100644 --- a/spec/language/ruby/global_test/conditional/very_mix_conditional_spec.rb +++ b/spec/language/ruby/global_test/conditional/very_mix_conditional_spec.rb @@ -2,7 +2,7 @@ RSpec.describe Kuniri::Kuniri do - before :each do + before :all do @path = "./spec/language/ruby/global_test/conditional/.kuniri4.yml" @kuniri = Kuniri::Kuniri.new @kuniri.read_configuration_file(@path) @@ -11,7 +11,7 @@ parser.create_all_data(@kuniri.get_parser()) target = "./spec/language/ruby/global_test/conditional/" + "veryMixConditional.xml" - @output = File.open(target, "r") + @output = File.open(target, "r").read.split("\n") end RSpec.shared_examples "Very mix conditional" do |regex, description| @@ -97,7 +97,7 @@ end - after :each do + after :all do @kuniri = nil @output = nil end diff --git a/spec/language/ruby/global_test/conditional_and_repetition/mix_conditional_repetition_spec.rb b/spec/language/ruby/global_test/conditional_and_repetition/mix_conditional_repetition_spec.rb index e18e528..d13b846 100644 --- a/spec/language/ruby/global_test/conditional_and_repetition/mix_conditional_repetition_spec.rb +++ b/spec/language/ruby/global_test/conditional_and_repetition/mix_conditional_repetition_spec.rb @@ -2,7 +2,7 @@ RSpec.describe "Mix conditional and repetition in the same code" do - before :each do + before :all do @path = "./spec/language/ruby/global_test/conditional_and_repetition/.kuniri.yml" @kuniri = Kuniri::Kuniri.new @kuniri.read_configuration_file(@path) @@ -11,7 +11,7 @@ parser.create_all_data(@kuniri.get_parser()) target = './spec/language/ruby/global_test/conditional_and_repetition/' + 'mixConditionalRepetition.xml' - @output = File.open(target, 'r') + @output = File.open(target, 'r').read.split("\n") end RSpec.shared_examples "Multiple verification" do |regex, description| @@ -51,7 +51,7 @@ end - after :each do + after :all do @kuniri = nil @output = nil end diff --git a/spec/language/ruby/global_test/constructor/different_constructors_spec.rb b/spec/language/ruby/global_test/constructor/different_constructors_spec.rb index a71a46f..faff86d 100644 --- a/spec/language/ruby/global_test/constructor/different_constructors_spec.rb +++ b/spec/language/ruby/global_test/constructor/different_constructors_spec.rb @@ -2,7 +2,7 @@ RSpec.describe Kuniri::Kuniri do - before :each do + before :all do @path = './spec/language/ruby/global_test/constructor/.kuniri1.yml' @kuniri = Kuniri::Kuniri.new @kuniri.read_configuration_file(@path) @@ -10,7 +10,7 @@ parser = Parser::XMLOutputFormat.new(0, @kuniri.configurationInfo[:output]) parser.create_all_data(@kuniri.get_parser()) target = './spec/language/ruby/global_test/constructor/different_constructors.xml' - @output = File.open(target, 'r') + @output = File.open(target, 'r').read.split("\n") end RSpec.shared_examples 'Constructor verification' do |regex, description| @@ -73,7 +73,7 @@ end end - after :each do + after :all do @kuniri = nil @output = nil end diff --git a/spec/language/ruby/global_test/global_variable/global_variable_spec.rb b/spec/language/ruby/global_test/global_variable/global_variable_spec.rb index d10e39c..f263895 100644 --- a/spec/language/ruby/global_test/global_variable/global_variable_spec.rb +++ b/spec/language/ruby/global_test/global_variable/global_variable_spec.rb @@ -2,7 +2,7 @@ RSpec.describe Kuniri::Kuniri do - before :each do + before :all do @path = "./spec/language/ruby/global_test/global_variable/.kuniri.yml" @kuniri = Kuniri::Kuniri.new @kuniri.read_configuration_file(@path) @@ -10,7 +10,7 @@ parser = Parser::XMLOutputFormat.new(0, @kuniri.configurationInfo[:output]) parser.create_all_data(@kuniri.get_parser()) target = "./spec/language/ruby/global_test/global_variable/simpleVariable.xml" - @output = File.open(target, "r") + @output = File.open(target, "r").read.split("\n") end RSpec.shared_examples "global variable" do |regex, description| @@ -97,7 +97,7 @@ end end - after :each do + after :all do @kuniri = nil @output = nil end diff --git a/spec/language/ruby/global_test/repetition/complete_class_integrity.rb b/spec/language/ruby/global_test/repetition/complete_class_integrity.rb index 7e714c0..18b9df6 100644 --- a/spec/language/ruby/global_test/repetition/complete_class_integrity.rb +++ b/spec/language/ruby/global_test/repetition/complete_class_integrity.rb @@ -30,7 +30,7 @@ end expect(@stack.size).to eq(0) - + end end after :each do diff --git a/spec/language/ruby/global_test/repetition/complete_class_until_loop_spec.rb b/spec/language/ruby/global_test/repetition/complete_class_until_loop_spec.rb index 57764f5..7cd6b66 100644 --- a/spec/language/ruby/global_test/repetition/complete_class_until_loop_spec.rb +++ b/spec/language/ruby/global_test/repetition/complete_class_until_loop_spec.rb @@ -2,7 +2,7 @@ RSpec.describe "Verify class with while loop" do - before :each do + before :all do @path = "./spec/language/ruby/global_test/repetition/.kuniri3.yml" @kuniri = Kuniri::Kuniri.new @kuniri.read_configuration_file(@path) @@ -10,7 +10,7 @@ parser = Parser::XMLOutputFormat.new(0, @kuniri.configurationInfo[:output]) parser.create_all_data(@kuniri.get_parser()) target = "./spec/language/ruby/global_test/repetition/untilInClass.xml" - @output = File.open(target, "r") + @output = File.open(target, "r").read.split("\n") end RSpec.shared_examples "Class with until" do |regex, description| @@ -34,7 +34,7 @@ end - after :each do + after :all do @kuniri = nil @output = nil end diff --git a/spec/language/ruby/global_test/repetition/complete_class_while_loop_spec.rb b/spec/language/ruby/global_test/repetition/complete_class_while_loop_spec.rb index e00d971..1b09bc2 100644 --- a/spec/language/ruby/global_test/repetition/complete_class_while_loop_spec.rb +++ b/spec/language/ruby/global_test/repetition/complete_class_while_loop_spec.rb @@ -2,7 +2,7 @@ RSpec.describe "Verify class with while loop" do - before :each do + before :all do @path = "./spec/language/ruby/global_test/repetition/.kuniri2.yml" @kuniri = Kuniri::Kuniri.new @kuniri.read_configuration_file(@path) @@ -10,7 +10,7 @@ parser = Parser::XMLOutputFormat.new(0, @kuniri.configurationInfo[:output]) parser.create_all_data(@kuniri.get_parser()) target = "./spec/language/ruby/global_test/repetition/whileLoopInClass.xml" - @output = File.open(target, "r") + @output = File.open(target, "r").read.split("\n") end RSpec.shared_examples "Class with while" do |regex, description| @@ -34,7 +34,7 @@ end - after :each do + after :all do @kuniri = nil @output = nil end diff --git a/spec/language/ruby/global_test/repetition/complete_class_with_repetition_spec.rb b/spec/language/ruby/global_test/repetition/complete_class_with_repetition_spec.rb index ddde46b..838bab9 100644 --- a/spec/language/ruby/global_test/repetition/complete_class_with_repetition_spec.rb +++ b/spec/language/ruby/global_test/repetition/complete_class_with_repetition_spec.rb @@ -2,7 +2,7 @@ RSpec.describe Kuniri::Kuniri do - before :each do + before :all do @path = "./spec/language/ruby/global_test/repetition/.kuniri4.yml" @kuniri = Kuniri::Kuniri.new @kuniri.read_configuration_file(@path) @@ -10,7 +10,7 @@ parser = Parser::XMLOutputFormat.new(0, @kuniri.configurationInfo[:output]) parser.create_all_data(@kuniri.get_parser()) target = "./spec/language/ruby/global_test/repetition/forLoopInClass.xml" - @output = File.open(target, "r") + @output = File.open(target, "r").read.split("\n") end RSpec.shared_examples "Complete class with repetition" do |regex, description| @@ -34,7 +34,7 @@ end - after :each do + after :all do @kuniri = nil @output = nil end diff --git a/spec/language/ruby/global_test/repetition/constructor_with_mix_repetition_spec.rb b/spec/language/ruby/global_test/repetition/constructor_with_mix_repetition_spec.rb index 737f49c..0f3d7f4 100644 --- a/spec/language/ruby/global_test/repetition/constructor_with_mix_repetition_spec.rb +++ b/spec/language/ruby/global_test/repetition/constructor_with_mix_repetition_spec.rb @@ -2,14 +2,14 @@ RSpec.describe "Verify repetition output" do - before :each do + before :all do @path = "./spec/language/ruby/global_test/repetition/.kuniri8.yml" @kuniri = Kuniri::Kuniri.new @kuniri.read_configuration_file(@path) @kuniri.run_analysis parser = Parser::XMLOutputFormat.new(0, @kuniri.configurationInfo[:output]) parser.create_all_data(@kuniri.get_parser()) - @output = File.open("./spec/language/ruby/global_test/repetition/constructorWithMixRepetition.xml", "r") + @output = File.open("./spec/language/ruby/global_test/repetition/constructorWithMixRepetition.xml", "r").read.split("\n") end RSpec.shared_examples "Constructor multiple verification" do |regex, description| @@ -49,7 +49,7 @@ end - after :each do + after :all do @kuniri = nil @output = nil end diff --git a/spec/language/ruby/global_test/repetition/method_with_mix_repetition_spec.rb b/spec/language/ruby/global_test/repetition/method_with_mix_repetition_spec.rb index 84be9e0..532a9fc 100644 --- a/spec/language/ruby/global_test/repetition/method_with_mix_repetition_spec.rb +++ b/spec/language/ruby/global_test/repetition/method_with_mix_repetition_spec.rb @@ -2,7 +2,7 @@ RSpec.describe "Verify repetition output" do - before :each do + before :all do @path = "./spec/language/ruby/global_test/repetition/.kuniri7.yml" @kuniri = Kuniri::Kuniri.new @kuniri.read_configuration_file(@path) @@ -11,7 +11,7 @@ parser.create_all_data(@kuniri.get_parser()) target = "./spec/language/ruby/global_test/repetition/" + "methodWithMixRepetition.xml" - @output = File.open(target, "r") + @output = File.open(target, "r").read.split("\n") end RSpec.shared_examples "Method multiple verification" do |regex, description| @@ -51,7 +51,7 @@ end - after :each do + after :all do @kuniri = nil @output = nil end diff --git a/spec/language/ruby/global_test/repetition/very_mix_repetition_spec.rb b/spec/language/ruby/global_test/repetition/very_mix_repetition_spec.rb index 507a956..955500c 100644 --- a/spec/language/ruby/global_test/repetition/very_mix_repetition_spec.rb +++ b/spec/language/ruby/global_test/repetition/very_mix_repetition_spec.rb @@ -2,14 +2,14 @@ RSpec.describe "Verify repetition output" do - before :each do + before :all do @path = "./spec/language/ruby/global_test/repetition/.kuniri5.yml" @kuniri = Kuniri::Kuniri.new @kuniri.read_configuration_file(@path) @kuniri.run_analysis parser = Parser::XMLOutputFormat.new(0, @kuniri.configurationInfo[:output]) parser.create_all_data(@kuniri.get_parser()) - @output = File.open("./spec/language/ruby/global_test/repetition/veryMixRepetition.xml", "r") + @output = File.open("./spec/language/ruby/global_test/repetition/veryMixRepetition.xml", "r").read.split("\n") end RSpec.shared_examples "Mix multiple verification" do |regex, description| @@ -53,7 +53,7 @@ end - after :each do + after :all do @kuniri = nil @output = nil end diff --git a/spec/language/ruby/global_test/repetition/very_nested_repetition_spec.rb b/spec/language/ruby/global_test/repetition/very_nested_repetition_spec.rb index 0d8d851..68ad0c0 100644 --- a/spec/language/ruby/global_test/repetition/very_nested_repetition_spec.rb +++ b/spec/language/ruby/global_test/repetition/very_nested_repetition_spec.rb @@ -2,14 +2,14 @@ RSpec.describe "Verify repetition output with a nested conditional" do - before :each do + before :all do @path = "./spec/language/ruby/global_test/repetition/.kuniri6.yml" @kuniri = Kuniri::Kuniri.new @kuniri.read_configuration_file(@path) @kuniri.run_analysis parser = Parser::XMLOutputFormat.new(0, @kuniri.configurationInfo[:output]) parser.create_all_data(@kuniri.get_parser()) - @output = File.open("./spec/language/ruby/global_test/repetition/veryNestedRepetition.xml", "r") + @output = File.open("./spec/language/ruby/global_test/repetition/veryNestedRepetition.xml", "r").read.split("\n") end RSpec.shared_examples "Nested multiple verification" do |regex, description| @@ -57,7 +57,7 @@ end - after :each do + after :all do @kuniri = nil @output = nil end diff --git a/spec/language/ruby/global_test/troublemakers/global_variable_spec_sample.rb b/spec/language/ruby/global_test/troublemakers/global_variable_spec_sample.rb index ee94f41..14a335d 100644 --- a/spec/language/ruby/global_test/troublemakers/global_variable_spec_sample.rb +++ b/spec/language/ruby/global_test/troublemakers/global_variable_spec_sample.rb @@ -2,7 +2,7 @@ RSpec.describe Kuniri::Kuniri do - before :each do + before :all do @path = "./spec/language/ruby/global_test/global_variable/.kuniri.yml" @kuniri = Kuniri::Kuniri.new @kuniri.read_configuration_file(@path) @@ -10,7 +10,7 @@ parser = Parser::XMLOutputFormat.new(@kuniri.configurationInfo[:output]) parser.create_all_data(@kuniri.get_parser()) target = "./spec/language/ruby/global_test/global_variable/simpleVariable.xml" - @output = File.open(target, "r") + @output = File.open(target, "r").read.split("\n") end RSpec.shared_examples "global variable" do |regex, description| @@ -86,7 +86,7 @@ end end - after :each do + after :all do @kuniri = nil @output = nil end