<commit_before>require 'spec_helper'

describe Fastlane::Actions::IncrementVersionCodeAction do
  describe "Increment version code" do
    before do
      copy_build_fixture
    end

    def execute_lane_test
      Fastlane::FastFile.new.parse("lane :test do
        increment_version_code(
          app_project_dir: \"../**/app\"
        )
      end").runner.execute(:test)
    end

    def execute_lane_option_test
      Fastlane::FastFile.new.parse("lane :test do
        increment_version_code(
          app_project_dir: \"../**/app\",
          version_code: 123457
        )
      end").runner.execute(:test)
    end

    def execute_lane_automatic_test
      Fastlane::FastFile.new.parse("lane :test do
        increment_version_code(
          app_project_dir: \"../**/app\",
          version_code: -1
        )
      end").runner.execute(:test)
    end

    it "should return incremented version code from build.gradle" do
      expect(execute_lane_test).to eq("12346")
    end

    it "should return incremented fixmun version code from build.gradle" do
      expect(execute_lane_option_test).to eq("123457")
    end

    it "should set VERSION_CODE shared value" do
      result = execute_lane_test
      expect(Fastlane::Actions.lane_context[Fastlane::Actions::SharedValues::VERSION_CODE]).to eq("12346")
    end

    it "should set VERSION_CODE to current minute" do
      expected_result = ((Time.now.to_f * 1000).to_i / (60 * 1000)).to_s
      expect(execute_lane_automatic_test).to eq(expected_result)
    end
<commit_msg>Rename the test for clarity<commit_after>require 'spec_helper'

describe Fastlane::Actions::IncrementVersionCodeAction do
  describe "Increment version code" do
    before do
      copy_build_fixture
    end

    def execute_lane_test
      Fastlane::FastFile.new.parse("lane :test do
        increment_version_code(
          app_project_dir: \"../**/app\"
        )
      end").runner.execute(:test)
    end

    def execute_lane_option_test
      Fastlane::FastFile.new.parse("lane :test do
        increment_version_code(
          app_project_dir: \"../**/app\",
          version_code: 123457
        )
      end").runner.execute(:test)
    end

    def execute_lane_automatic_test
      Fastlane::FastFile.new.parse("lane :test do
        increment_version_code(
          app_project_dir: \"../**/app\",
          version_code: -1
        )
      end").runner.execute(:test)
    end

    it "should return incremented version code from build.gradle" do
      expect(execute_lane_test).to eq("12346")
    end

    it "should return incremented fixmun version code from build.gradle" do
      expect(execute_lane_option_test).to eq("123457")
    end

    it "should set VERSION_CODE shared value" do
      result = execute_lane_test
      expect(Fastlane::Actions.lane_context[Fastlane::Actions::SharedValues::VERSION_CODE]).to eq("12346")
    end

    it "should set VERSION_CODE to current minute when option is -1" do
      expected_result = ((Time.now.to_f * 1000).to_i / (60 * 1000)).to_s
      expect(execute_lane_automatic_test).to eq(expected_result)
    end

{'fraction_non_alphanumeric': 0.10244059087989724, 'fraction_numerical': 0.02151573538856776, 'mean_word_length': 2.826781326781327, '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': '3850680', 'n_tokens_mistral': 997, 'n_tokens_neox': 936, 'n_words': 210}