<commit_before>require "spec_helper"

module C2y
  describe DSL do
    describe "user" do
      context "with options" do
        let(:cloudconfigfile) do
          CloudConfigFile.create do
          <<-EOS
user "dtan4" do
  github "dtan4"
  groups %w(sudo docker)
end
          EOS
          end
        end

        it do
          dsl = described_class.parse(cloudconfigfile)
          expect(dsl.users.length).to eq 1
          user = dsl.users.first
          expect(user.name).to eq "dtan4"
          expect(user.github).to eq "dtan4"
          expect(user.groups).to eql(%w(sudo docker))
        end
      end<commit_msg>Rerite user_dsl_spec<commit_after>require "spec_helper"

module C2y
  describe DSL do
    describe "user" do
      context "with options" do
        let(:cloudconfigfile) do
          CloudConfigFile.create do
          <<-EOS
user "dtan4" do
  github "dtan4"
  groups %w(sudo docker)
end
          EOS
          end
        end

        subject do
          dsl = described_class.parse(cloudconfigfile)
          dsl.users.first
        end

        its(:name) { is_expected.to eq "dtan4" }
        its(:github) { is_expected.to eq "dtan4" }
        its(:groups) { is_expected.to eql(%w(sudo docker)) }
      end
{'fraction_non_alphanumeric': 0.09017713365539452, 'fraction_numerical': 0.008856682769726247, 'mean_word_length': 1.8974358974358974, 'pattern_counts': {'":': 0, '<': 7, '<?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': '5691647', 'n_tokens_mistral': 413, 'n_tokens_neox': 396, 'n_words': 101}