<commit_before>require 'spec_helper'
require_relative '../../../libraries/consul_installation'
require_relative '../../../libraries/consul_installation_webui'

describe ConsulCookbook::Provider::ConsulInstallationWebui do
  step_into(:consul_installation)
  before { default_attributes['consul'] ||= {} }
  let(:chefspec_options) { {platform: 'ubuntu', version: '14.04'} }

  context 'webui installation' do
    pending('replace with poise-archive')

    recipe do
      consul_installation '0.7.0' do
        provider :webui
      end
    end

    it do is_expected.to create_directory('/opt/consul-webui/0.7.0')
      .with(
        recursive: true
      )
    end

    it do is_expected.to create_directory('/var/lib/consul')
      .with(
        recursive: true
      )
    end

    it do is_expected.to unzip_zipfile('consul_0.7.0_web_ui.zip')
      .with(
        checksum: '5f8841b51e0e3e2eb1f1dc66a47310ae42b0448e77df14c83bb49e0e0d5fa4b7',
        path: '/opt/consul-webui/0.7.0',<commit_msg>Updating webui checksum in tests<commit_after>require 'spec_helper'
require_relative '../../../libraries/consul_installation'
require_relative '../../../libraries/consul_installation_webui'

describe ConsulCookbook::Provider::ConsulInstallationWebui do
  step_into(:consul_installation)
  before { default_attributes['consul'] ||= {} }
  let(:chefspec_options) { {platform: 'ubuntu', version: '14.04'} }

  context 'webui installation' do
    pending('replace with poise-archive')

    recipe do
      consul_installation '0.7.0' do
        provider :webui
      end
    end

    it do is_expected.to create_directory('/opt/consul-webui/0.7.0')
      .with(
        recursive: true
      )
    end

    it do is_expected.to create_directory('/var/lib/consul')
      .with(
        recursive: true
      )
    end

    it do is_expected.to unzip_zipfile('consul_0.7.0_web_ui.zip')
      .with(
        checksum: '42212089c228a73a0881a5835079c8df58a4f31b5060a3b4ffd4c2497abe3aa8',
        path: '/opt/consul-webui/0.7.0',
{'fraction_non_alphanumeric': 0.12382367508667658, 'fraction_numerical': 0.05596830113917781, 'mean_word_length': 3.1478439425051334, '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': '2137503', 'n_tokens_mistral': 765, 'n_tokens_neox': 715, 'n_words': 119}