<commit_before>require 'spec_helper'

describe "DittoCode::Exec blocks and inline conditionals" do 

	# Test to check execution of code with 1 environment
	describe 'exec a block based on one environment (PRO)' do

		it 'The gem must exec this code' do

			# Initiathe the env
			ENV["DITTOCODE_ENV"] = "PRO"

			result = Code.pro_environment

			expect(result).to eq("I'm pro")

		end

		it 'The gem musn\'t exec this code' do

			# Initiathe the env
			ENV["DITTOCODE_ENV"] = "FREE"

			result = Code.pro_environment

			expect(result).to eq(nil)

		end

	end

	# Multiple environments
	describe 'exec a block based on two environments (PRO,PREMIUM)' do

		it 'The gem must exec this code' do

			# Initiathe the env
			ENV["DITTOCODE_ENV"] = "PRO"
			result_pro = Code.pro_and_free_environment

			ENV["DITTOCODE_ENV"] = "FREE"
			result_free = Code.pro_and_free_environment

			expect(result_pro).to eq("I'm free or pro")
			expect(result_free).to eq("I'm free or pro")

		end

		it 'The gem musn\'t exec this code' do

			# Initiathe the env
			ENV["DITTOCODE_ENV"] = "PREMIUM"
			result = Code.pro_and_free_environment

			expect(result).to eq(nil)

		end

	end

	# Inline conditional
	describe 'exec a line based on one environment (PRO)' do

		it 'The gem must exec this line' do

			# Initiathe the env
			ENV["DITTOCODE_ENV"] = "PRO"

			result = Code.conditional_pro_environment

			expect(result).to eq("I'm pro")

		end

		it 'The gem musn\'t exec this line' do

			# Initiathe the env
			ENV["DITTOCODE_ENV"] = "FREE"

			result = Code.conditional_pro_environment

			expect(result).to eq("I'm not pro")

		end

	end

	# Multiple environments
	describe 'exec a line based on two environments (PRO,PREMIUM)' do

		it 'The gem must exec this line' do

			# Initiathe the env
			ENV["DITTOCODE_ENV"] = "PRO"
			result_pro = Code.conditional_pro_and_free_environment

			ENV["DITTOCODE_ENV"] = "FREE"
			result_free = Code.conditional_pro_and_free_environment

			ENV["DITTOCODE_ENV"] = "FREE,PRO"
			result_free_or_pro = Code.conditional_pro_and_free_environment

			expect(result_pro).to eq("I'm free or pro")
			expect(result_free).to eq("I'm free or pro")
			expect(result_free_or_pro).to eq("I'm free or pro")

		end

		it 'The gem musn\'t exec this line' do

			# Initiathe the env
			ENV["DITTOCODE_ENV"] = "PREMIUM"
			result = Code.conditional_pro_and_free_environment

			expect(result).to eq(nil)

		end

	end

	# A fail test to check TeamCity
	describe 'Exec a fail test to check TeamCity CI' do

		it 'The gem must fail this' do

			# Initiathe the env
			ENV["DITTOCODE_ENV"] = "PRO"
			result_pro = Code.conditional_pro_and_free_environment

			expect(result_pro).to eq(nil)

		end

	end

end<commit_msg>Fixed the test to check TeamCity CI<commit_after>require 'spec_helper'

describe "DittoCode::Exec blocks and inline conditionals" do 

	# Test to check execution of code with 1 environment
	describe 'exec a block based on one environment (PRO)' do

		it 'The gem must exec this code' do

			# Initiathe the env
			ENV["DITTOCODE_ENV"] = "PRO"

			result = Code.pro_environment

			expect(result).to eq("I'm pro")

		end

		it 'The gem musn\'t exec this code' do

			# Initiathe the env
			ENV["DITTOCODE_ENV"] = "FREE"

			result = Code.pro_environment

			expect(result).to eq(nil)

		end

	end

	# Multiple environments
	describe 'exec a block based on two environments (PRO,PREMIUM)' do

		it 'The gem must exec this code' do

			# Initiathe the env
			ENV["DITTOCODE_ENV"] = "PRO"
			result_pro = Code.pro_and_free_environment

			ENV["DITTOCODE_ENV"] = "FREE"
			result_free = Code.pro_and_free_environment

			expect(result_pro).to eq("I'm free or pro")
			expect(result_free).to eq("I'm free or pro")

		end

		it 'The gem musn\'t exec this code' do

			# Initiathe the env
			ENV["DITTOCODE_ENV"] = "PREMIUM"
			result = Code.pro_and_free_environment

			expect(result).to eq(nil)

		end

	end

	# Inline conditional
	describe 'exec a line based on one environment (PRO)' do

		it 'The gem must exec this line' do

			# Initiathe the env
			ENV["DITTOCODE_ENV"] = "PRO"

			result = Code.conditional_pro_environment

			expect(result).to eq("I'm pro")

		end

		it 'The gem musn\'t exec this line' do

			# Initiathe the env
			ENV["DITTOCODE_ENV"] = "FREE"

			result = Code.conditional_pro_environment

			expect(result).to eq("I'm not pro")

		end

	end

	# Multiple environments
	describe 'exec a line based on two environments (PRO,PREMIUM)' do

		it 'The gem must exec this line' do

			# Initiathe the env
			ENV["DITTOCODE_ENV"] = "PRO"
			result_pro = Code.conditional_pro_and_free_environment

			ENV["DITTOCODE_ENV"] = "FREE"
			result_free = Code.conditional_pro_and_free_environment

			ENV["DITTOCODE_ENV"] = "FREE,PRO"
			result_free_or_pro = Code.conditional_pro_and_free_environment

			expect(result_pro).to eq("I'm free or pro")
			expect(result_free).to eq("I'm free or pro")
			expect(result_free_or_pro).to eq("I'm free or pro")

		end

		it 'The gem musn\'t exec this line' do

			# Initiathe the env
			ENV["DITTOCODE_ENV"] = "PREMIUM"
			result = Code.conditional_pro_and_free_environment

			expect(result).to eq(nil)

		end

	end

end
{'fraction_non_alphanumeric': 0.09696036937283571, 'fraction_numerical': 0.00038476337052712584, 'mean_word_length': 3.6254448398576513, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7415637', 'n_tokens_mistral': 2107, 'n_tokens_neox': 1771, 'n_words': 539}