Sha256: ab453945c45883999071e3fea19af3992b93915f00da576a14af6ad7ecb26e13

Contents?: true

Size: 844 Bytes

Versions: 1

Compression:

Stored size: 844 Bytes

Contents

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

describe GemRepo do
  before(:all) { GemRepo.set :gemdir, gemdir }
  after { clear_gemdir }

  it "should fail if the pushed gem is invalid" do
    post "/api/v1/gems"

    last_response.status.should == 422
    last_response.body.should == "invalid gem"
  end

  it "should succeed if the pushed gem is valid" do
    current_gems.should be_empty
    current_index.should be_nil

    post "/api/v1/gems", sample_gem

    last_response.should be_ok
    last_response.body.should == "Successfully registered gem: sample"

    current_gems.size.should == 1
    current_index.should_not be_nil
  end

  it "should serve the index" do
    create_index

    get "/yaml"

    last_response.should be_ok
    YAML.load(last_response.body).should be_kind_of(Gem::SourceIndex)
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gemrepo-0.1.0 spec/gemrepo_spec.rb