<commit_before>describe Fastlane do
  describe Fastlane::FastFile do
    describe "Slack Action" do
      before :each do
        # Fastlane::Actions.lane_context[Fastlane::Actions::SharedValues::BUILD_NUMBER] = build_number
        ENV['SLACK_URL'] = 'http://127.0.0.1'
      end

      it "trims long messages to show the bottom of the messages" do
        long_text = "a" * 10000
        expect(Fastlane::Actions::SlackAction.trim_message(long_text).length).to eq(7000)
      end

      it "works so perfect, like Slack does" do
        channel = "#myChannel"
        message = "Custom Message"
        lane_name = "lane_name"

        Fastlane::Actions.lane_context[Fastlane::Actions::SharedValues::LANE_NAME] = lane_name

        notifier, attachments = Fastlane::Actions::SlackAction.run([{
          message: message,
          success: false,
          channel: channel
        }])

        expect(notifier.default_payload[:username]).to eq('fastlane')
        expect(notifier.default_payload[:channel]).to eq(channel)

        expect(attachments[:color]).to eq('danger')
        expect(attachments[:text]).to eq(message)

        fields = attachments[:fields]
        expect(fields[0][:title]).to eq('Lane')
        expect(fields[0][:value]).to eq(lane_name)

        expect(fields[1][:title]).to eq('Test Result')
        expect(fields[1][:value]).to eq('Error')
      end
    end
  end
end
<commit_msg>Added slack test if no Slack URL was passed<commit_after>describe Fastlane do
  describe Fastlane::FastFile do
    describe "Slack Action" do
      before :each do
        ENV['SLACK_URL'] = 'http://127.0.0.1'
      end

      it "trims long messages to show the bottom of the messages" do
        long_text = "a" * 10000
        expect(Fastlane::Actions::SlackAction.trim_message(long_text).length).to eq(7000)
      end

      it "raises an error if no slack URL is given" do
        ENV.delete 'SLACK_URL'
        expect {
          Fastlane::Actions::SlackAction.run([])
        }.to raise_exception('No SLACK_URL given.'.red)
      end

      it "works so perfect, like Slack does" do
        channel = "#myChannel"
        message = "Custom Message"
        lane_name = "lane_name"

        Fastlane::Actions.lane_context[Fastlane::Actions::SharedValues::LANE_NAME] = lane_name

        notifier, attachments = Fastlane::Actions::SlackAction.run([{
          message: message,
          success: false,
          channel: channel
        }])

        expect(notifier.default_payload[:username]).to eq('fastlane')
        expect(notifier.default_payload[:channel]).to eq(channel)

        expect(attachments[:color]).to eq('danger')
        expect(attachments[:text]).to eq(message)

        fields = attachments[:fields]
        expect(fields[0][:title]).to eq('Lane')
        expect(fields[0][:value]).to eq(lane_name)

        expect(fields[1][:title]).to eq('Test Result')
        expect(fields[1][:value]).to eq('Error')
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.1271870794078062, 'fraction_numerical': 0.01278600269179004, 'mean_word_length': 2.8066581306017926, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '4916837', 'n_tokens_mistral': 917, 'n_tokens_neox': 867, 'n_words': 196}