Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read files once per test in global_test #237

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions spec/language/ruby/global_test/blocks/simple_blocks_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

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)
@kuniri.run_analysis
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|
Expand Down Expand Up @@ -46,7 +46,7 @@

end

after :each do
after :all do
@kuniri = nil
@output = nil
end
Expand Down
6 changes: 3 additions & 3 deletions spec/language/ruby/global_test/complete_class_ruby_O1_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -189,7 +189,7 @@

end

after :each do
after :all do
@kuniri = nil
@output = nil
end
Expand Down
6 changes: 3 additions & 3 deletions spec/language/ruby/global_test/complete_class_ruby_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -190,7 +190,7 @@

end

after :each do
after :all do
@kuniri = nil
@output = nil
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

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)
@kuniri.run_analysis
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|
Expand Down Expand Up @@ -84,7 +84,7 @@

end

after :each do
after :all do
@kuniri = nil
@output1 = nil
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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|
Expand Down Expand Up @@ -97,7 +97,7 @@

end

after :each do
after :all do
@kuniri = nil
@output = nil
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

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)
@kuniri.run_analysis
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|
Expand Down Expand Up @@ -86,7 +86,7 @@
end
end

after :each do
after :all do
@kuniri = nil
@output = nil
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

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)
@kuniri.run_analysis
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|
Expand Down Expand Up @@ -48,7 +48,7 @@

end

after :each do
after :all do
@kuniri = nil
@output = nil
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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|
Expand Down Expand Up @@ -101,7 +101,7 @@

end

after :each do
after :all do
@kuniri = nil
@output = nil
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

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)
@kuniri.run_analysis
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|
Expand Down Expand Up @@ -70,7 +70,7 @@
end
end

after :each do
after :all do
@kuniri = nil
@output = nil
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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|
Expand Down Expand Up @@ -53,7 +53,7 @@

end

after :each do
after :all do
@kuniri = nil
@output = nil
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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|
Expand Down Expand Up @@ -97,7 +97,7 @@

end

after :each do
after :all do
@kuniri = nil
@output = nil
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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|
Expand Down Expand Up @@ -51,7 +51,7 @@

end

after :each do
after :all do
@kuniri = nil
@output = nil
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

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)
@kuniri.run_analysis
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|
Expand Down Expand Up @@ -73,7 +73,7 @@
end
end

after :each do
after :all do
@kuniri = nil
@output = nil
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

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)
@kuniri.run_analysis
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|
Expand Down Expand Up @@ -97,7 +97,7 @@
end
end

after :each do
after :all do
@kuniri = nil
@output = nil
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
end

expect(@stack.size).to eq(0)

end
end

after :each do
Expand Down
Loading