<commit_before>require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe Rubydariah::Storage do
#  before do
#    VCR.insert_cassette 'player', :record => :new_episodes
#  end
#
#  after do
#    VCR.eject_cassette
#  end

  before do
    @auth = Rubydariah::Storage.new("http://ipedariah1.lsdf.kit.edu:8080/StorageImplementation-1.0-SNAPSHOT", "foo", "bar")
  end

  it "should create a new object" do
    @auth.should be_kind_of Rubydariah::Storage
  end

  it "should post a file" do
    VCR.use_cassette 'post' do
      response = @auth.post(File.expand_path(File.dirname(__FILE__) + '/fixtures/samplefile.mp3'))
      response.code.should == 201

      pid = URI(response.headers[:location]).path.split('/').last
      response = @auth.delete(pid)
      response.code.should == 204
    end
  end

  it "should get a file" do
    VCR.use_cassette 'get' do
      response = @auth.post(File.expand_path(File.dirname(__FILE__) + '/fixtures/samplefile.mp3'))
      response.code.should == 201

      pid = URI(response.headers[:location]).path.split('/').last
      response = @auth.get(pid)
      response.code.should == 200

      response = @auth.delete(pid)
      response.code.should == 204
    end
  end


  it "should get a list of options in the headers" do
    VCR.use_cassette 'options' do
      response = @auth.options
      response.code.should == 200
    end
  end

end<commit_msg>check that allow includes methods as per api doc<commit_after>require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe Rubydariah::Storage do
#  before do
#    VCR.insert_cassette 'player', :record => :new_episodes
#  end
#
#  after do
#    VCR.eject_cassette
#  end

  before do
    @auth = Rubydariah::Storage.new("http://ipedariah1.lsdf.kit.edu:8080/StorageImplementation-1.0-SNAPSHOT", "foo", "bar")
  end

  it "should create a new object" do
    @auth.should be_kind_of Rubydariah::Storage
  end

  it "should post a file" do
    VCR.use_cassette 'post' do
      response = @auth.post(File.expand_path(File.dirname(__FILE__) + '/fixtures/samplefile.mp3'))
      response.code.should == 201

      pid = URI(response.headers[:location]).path.split('/').last
      response = @auth.delete(pid)
      response.code.should == 204
    end
  end

  it "should get a file" do
    VCR.use_cassette 'get' do
      response = @auth.post(File.expand_path(File.dirname(__FILE__) + '/fixtures/samplefile.mp3'))
      response.code.should == 201

      pid = URI(response.headers[:location]).path.split('/').last
      response = @auth.get(pid)
      response.code.should == 200

      response = @auth.delete(pid)
      response.code.should == 204
    end
  end


  it "should get a list of options in the headers" do
    VCR.use_cassette 'options' do
      response = @auth.options
      response.code.should == 200
      allow = response.headers[:allow]
      allow.should include "OPTIONS"
      allow.should include "GET"
      allow.should include "HEAD"
      allow.should include "POST"
      allow.should include "PUT"
      allow.should include "DELETE"
    end
  end

end
{'fraction_non_alphanumeric': 0.1259259259259259, 'fraction_numerical': 0.017391304347826087, 'mean_word_length': 3.060130718954248, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '626501', 'n_tokens_mistral': 1082, 'n_tokens_neox': 1021, 'n_words': 235}