<commit_before>require "spec_helper"

describe "using the server api" do
  context "with credentials are present" do
    Given(:home) {Pathname(set_env "HOME", File.expand_path(current_dir))}
    Given do
      File.open(home.join('.netrc'), "w") do |f|
        f.chmod 0600
        f.puts "machine api.rackspace.com"
        f.puts "  login #{ENV['RACKSPACE_USERNAME'] || '<rackspace-username>'}"
        f.puts "  password #{ENV['RACKSPACE_API_KEY'] || '<rackspace-api-key>'}"
      end
    end
    context "when I list all my servers (and I don't have any')" do
      When {VCR.use_cassette('show-servers') {run "rumm show servers"}}
      Then {all_stdout =~ /you don't have any servers/}
      And {last_exit_status.should eql 0}
    end
    context "when I create a server" do
      When {VCR.use_cassette('create-server') {run "rumm create server --name silly-saffron"}}
      Then {all_stdout =~ /created server (\w+)/}
      And {last_exit_status.should eql 0}
    end
    context "when I show a server" do
      When {VCR.use_cassette('show-server') {run "rumm show server silly-saffron"}}
      Then {last_exit_status.should eql 0}
    end
    context "when I destroy a server that exists" do
      When {VCR.use_cassette('destroy-server') {run "rumm destroy server silly-saffron"}}
      Then {all_stdout =~ /destruction/}
      And {last_exit_status.should eql 0}
    end
  end
end<commit_msg>serialize server specs so that they hopefully work<commit_after>require "spec_helper"

describe "using the server api" do
  context "with credentials are present" do
    Given(:home) {Pathname(set_env "HOME", File.expand_path(current_dir))}
    Given do
      File.open(home.join('.netrc'), "w") do |f|
        f.chmod 0600
        f.puts "machine api.rackspace.com"
        f.puts "  login #{ENV['RACKSPACE_USERNAME'] || '<rackspace-username>'}"
        f.puts "  password #{ENV['RACKSPACE_API_KEY'] || '<rackspace-api-key>'}"
      end
    end
    context "when I list all my servers (and I don't have any')" do
      When {VCR.use_cassette('show-servers') {run "rumm show servers"}}
      Then {all_stdout =~ /you don't have any servers/}
      And {last_exit_status.should eql 0}
      context "when I create a server" do
        When {VCR.use_cassette('create-server') {run "rumm create server --name silly-saffron"}}
        Then {all_stdout =~ /created server (\w+)/}
        And {last_exit_status.should eql 0}
      end
      context "when I show a server" do
        When {VCR.use_cassette('show-server') {run "rumm show server silly-saffron"}}
        Then {last_exit_status.should eql 0}
      end
      context "when I destroy a server that exists" do
        When {VCR.use_cassette('destroy-server') {run "rumm destroy server silly-saffron"}}
        Then {all_stdout =~ /destruction/}
        And {last_exit_status.should eql 0}
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.12304483837330553, 'fraction_numerical': 0.005561348627042058, 'mean_word_length': 2.9751381215469612, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '4797530', 'n_tokens_mistral': 981, 'n_tokens_neox': 959, 'n_words': 286}