text:
#pragma once
#include "crc32.h"
class CUserCmd
{
public:
	CRC32_t GetChecksum(void)
	{
		CRC32_t crc;

		gCRC.CRC32_Init(&crc);
		gCRC.CRC32_ProcessBuffer(&crc, &command_number, sizeof(command_number));
		gCRC.CRC32_ProcessBuffer(&crc, &tick_count, sizeof(tick_count));
		gCRC.CRC32_ProcessBuffer(&crc, &viewangles, sizeof(viewangles));
		gCRC.CRC32_ProcessBuffer(&crc, &aimdirection, sizeof(aimdirection));
		gCRC.CRC32_ProcessBuffer(&crc, &forwardmove, sizeof(forwardmove));
		gCRC.CRC32_ProcessBuffer(&crc, &sidemove, sizeof(sidemove));
		gCRC.CRC32_ProcessBuffer(&crc, &upmove, sizeof(upmove));
		gCRC.CRC32_ProcessBuffer(&crc, &buttons, sizeof(buttons));
		gCRC.CRC32_ProcessBuffer(&crc, &impulse, sizeof(impulse));
		gCRC.CRC32_ProcessBuffer(&crc, &weaponselect, sizeof(weaponselect));
		gCRC.CRC32_ProcessBuffer(&crc, &weaponsubtype, sizeof(weaponsubtype));
		gCRC.CRC32_ProcessBuffer(&crc, &random_seed, sizeof(random_seed));
		gCRC.CRC32_ProcessBuffer(&crc, &mousedx, sizeof(mousedx));
		gCRC.CRC32_ProcessBuffer(&crc, &mousedy, sizeof(mousedy));
		//gCRC.CRC32_ProcessBuffer( &crc, &hasbeenpredicted, sizeof( hasbeenpredicted ) );
		//gCRC.CRC32_ProcessBuffer( &crc, &headangles, sizeof( headangles ) );
		//gCRC.CRC32_ProcessBuffer( &crc, &headoffset, sizeof( headoffset ) );
		gCRC.CRC32_Final(&crc);

		return crc;
	}
	char pad_0x0000[0x4]; //0x0000
	int		command_number;		// 0x04 For matching server and client commands for debugging
	int		tick_count;			// 0x08 the tick the client created this command
	Vector	viewangles;			// 0x0C Player instantaneous view angles.
	Vector	aimdirection;		// 0x18
	float	forwardmove;		// 0x24
	float	sidemove;			// 0x28
	float	upmove;				// 0x2C
	int		buttons;			// 0x30 Attack button states
	byte    impulse;			// 0x34
	int		weaponselect;		// 0x38 Current weapon id
	int		weaponsubtype;		// 0x3C
	int		random_seed;		// 0x40 For shared random functions
	short	mousedx;			// 0x44 mouse accum in x from create move
	short	mousedy;			// 0x46 mouse accum in y from create move
	bool	hasbeenpredicted;	// 0x48 Client only, tracks whether we've predicted this command at least once
	char	pad_0x4C[0x18];		// 0x4C Current sizeof( usercmd ) =  100  = 0x64

};

/*
class CVerifiedUserCmd
{
public:
void* m_cmd; //0x0000
__int32 m_crc; //0x0004

};//Size=0x0008*/
class CVerifiedUserCmd
{
public:
	CUserCmd	m_cmd;
	unsigned long	m_crc;
};


text:
require 'helper'

describe Twitter::Client do

  before do
    @client = Twitter::Client.new
  end

  describe ".lists_subscribed_to" do
    context "with a screen name passed" do
      before do
        stub_get("/1/lists/all.json").
          with(:query => {:screen_name => "sferik"}).
          to_return(:body => fixture("all.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.lists_subscribed_to("sferik")
        a_get("/1/lists/all.json").
          with(:query => {:screen_name => "sferik"}).
          should have_been_made
      end
      it "should return the lists the specified user subscribes to" do
        lists = @client.lists_subscribed_to("sferik")
        lists.should be_an Array
        lists.first.should be_a Twitter::List
        lists.first.name.should == "Rubyists"
      end
    end
    context "without a screen name passed" do
      before do
        stub_get("/1/account/verify_credentials.json").
          to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
        stub_get("/1/lists/all.json").
          to_return(:body => fixture("all.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.lists_subscribed_to
        a_get("/1/lists/all.json").
          should have_been_made
      end
    end
  end

  describe ".list_timeline" do
    context "with a screen name passed" do
      before do
        stub_get("/1/lists/statuses.json").
          with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents'}).
          to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list_timeline("sferik", "presidents")
        a_get("/1/lists/statuses.json").
          with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents'}).
          should have_been_made
      end
      it "should return the timeline for members of the specified list" do
        statuses = @client.list_timeline("sferik", "presidents")
        statuses.should be_an Array
        statuses.first.should be_a Twitter::Status
        statuses.first.text.should == "Ruby is the best programming language for hiding the ugly bits."
      end
    end
    context "without a screen name passed" do
      before do
        stub_get("/1/account/verify_credentials.json").
          to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
        stub_get("/1/lists/statuses.json").
          with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents'}).
          to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list_timeline("presidents")
        a_get("/1/lists/statuses.json").
          with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents'}).
          should have_been_made
      end
    end
    context "with an Integer list_id passed" do
      before do
        stub_get("/1/lists/statuses.json").
          with(:query => {:owner_screen_name => 'sferik', :list_id => '12345678'}).
          to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list_timeline("sferik", 12345678)
        a_get("/1/lists/statuses.json").
          with(:query => {:owner_screen_name => 'sferik', :list_id => '12345678'}).
          should have_been_made
      end
    end
    context "with an Integer user_id passed" do
      before do
        stub_get("/1/lists/statuses.json").
          with(:query => {:owner_id => '12345678', :slug => 'presidents'}).
          to_return(:body => fixture("statuses.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list_timeline(12345678, 'presidents')
        a_get("/1/lists/statuses.json").
          with(:query => {:owner_id => '12345678', :slug => 'presidents'}).
          should have_been_made
      end
    end
  end

  describe ".list_remove_member" do
    context "with a screen name passed" do
      before do
        stub_post("/1/lists/members/destroy.json").
          with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => "813286"}).
          to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list_remove_member("sferik", "presidents", 813286)
        a_post("/1/lists/members/destroy.json").
          with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => "813286"}).
          should have_been_made
      end
      it "should return the list" do
        list = @client.list_remove_member("sferik", "presidents", 813286)
        list.should be_a Twitter::List
        list.name.should == "presidents"
      end
    end
    context "with an Integer user_id passed" do
      before do
        stub_post("/1/lists/members/destroy.json").
          with(:body => {:owner_id => '12345678', :slug => 'presidents', :user_id => "813286"}).
          to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list_remove_member(12345678, "presidents", 813286)
        a_post("/1/lists/members/destroy.json").
          with(:body => {:owner_id => '12345678', :slug => 'presidents', :user_id => "813286"}).
          should have_been_made
      end
    end
    context "with an Integer list_id passed" do
      before do
        stub_post("/1/lists/members/destroy.json").
          with(:body => {:owner_screen_name => 'sferik', :list_id => '12345678', :user_id => "813286"}).
          to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list_remove_member('sferik', 12345678, 813286)
        a_post("/1/lists/members/destroy.json").
          with(:body => {:owner_screen_name => 'sferik', :list_id => '12345678', :user_id => "813286"}).
          should have_been_made
      end
    end
    context "with a screen name to remove" do
      before do
        stub_post("/1/lists/members/destroy.json").
          with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents', :screen_name => "erebor"}).
          to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list_remove_member('sferik', 'presidents', 'erebor')
        a_post("/1/lists/members/destroy.json").
          with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents', :screen_name => "erebor"}).
          should have_been_made
      end
    end
    context "without a screen name passed" do
      before do
        stub_get("/1/account/verify_credentials.json").
          to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
        stub_post("/1/lists/members/destroy.json").
          with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => "813286"}).
          to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list_remove_member("presidents", 813286)
        a_post("/1/lists/members/destroy.json").
          with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => "813286"}).
          should have_been_made
      end
    end
  end

  describe ".memberships" do
    context "with a screen name passed" do
      before do
        stub_get("/1/lists/memberships.json").
          with(:query => {:screen_name => 'pengwynn', :cursor => "-1"}).
          to_return(:body => fixture("lists.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.memberships("pengwynn")
        a_get("/1/lists/memberships.json").
          with(:query => {:screen_name => 'pengwynn', :cursor => "-1"}).
          should have_been_made
      end
      it "should return the lists the specified user has been added to" do
        memberships = @client.memberships("pengwynn")
        memberships.should be_a Twitter::Cursor
        memberships.lists.should be_an Array
        memberships.lists.first.should be_an Twitter::List
        memberships.lists.first.name.should == "Rubyists"
      end
    end
    context "without a screen name passed" do
      before do
        stub_get("/1/account/verify_credentials.json").
          to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
        stub_get("/1/lists/memberships.json").
          with(:query => {:cursor => "-1"}).
          to_return(:body => fixture("lists.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.memberships
        a_get("/1/lists/memberships.json").
          with(:query => {:cursor => "-1"}).
          should have_been_made
      end
    end
    context "with an Integer user_id passed" do
      before do
        stub_get("/1/lists/memberships.json").
          with(:query => {:user_id => '12345678', :cursor => "-1"}).
          to_return(:body => fixture("lists.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.memberships(12345678)
        a_get("/1/lists/memberships.json").
          with(:query => {:user_id => '12345678', :cursor => "-1"}).
          should have_been_made
      end
    end
  end

  describe ".list_subscribers" do
    context "with a screen name passed" do
      before do
        stub_get("/1/lists/subscribers.json").
          with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :cursor => "-1"}).
          to_return(:body => fixture("users_list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list_subscribers("sferik", "presidents")
        a_get("/1/lists/subscribers.json").
          with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :cursor => "-1"}).
          should have_been_made
      end
      it "should return the subscribers of the specified list" do
        list_subscribers = @client.list_subscribers("sferik", "presidents")
        list_subscribers.should be_a Twitter::Cursor
        list_subscribers.users.should be_an Array
        list_subscribers.users.first.should be_a Twitter::User
        list_subscribers.users.first.name.should == "Erik Michaels-Ober"
      end
    end
    context "with an Integer user passed" do
      before do
        stub_get("/1/lists/subscribers.json").
          with(:query => {:owner_id => '12345678', :slug => 'presidents', :cursor => "-1"}).
          to_return(:body => fixture("users_list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list_subscribers(12345678, "presidents")
        a_get("/1/lists/subscribers.json").
          with(:query => {:owner_id => '12345678', :slug => 'presidents', :cursor => "-1"}).
          should have_been_made
      end
    end
    context "with an Integer list_id passed" do
      before do
        stub_get("/1/lists/subscribers.json").
          with(:query => {:owner_screen_name => 'sferik', :list_id => '12345678', :cursor => "-1"}).
          to_return(:body => fixture("users_list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list_subscribers('sferik', 12345678)
        a_get("/1/lists/subscribers.json").
          with(:query => {:owner_screen_name => 'sferik', :list_id => '12345678', :cursor => "-1"}).
          should have_been_made
      end
    end
    context "without a screen name passed" do
      before do
        stub_get("/1/account/verify_credentials.json").
          to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
        stub_get("/1/lists/subscribers.json").
          with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :cursor => "-1"}).
          to_return(:body => fixture("users_list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list_subscribers("presidents")
        a_get("/1/lists/subscribers.json").
          with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :cursor => "-1"}).
          should have_been_made
      end
    end
  end

  describe ".subscriptions" do
    context "with a screen name passed" do
      before do
        stub_get("/1/lists/subscriptions.json").
          with(:query => {:screen_name => 'pengwynn', :cursor => "-1"}).
          to_return(:body => fixture("lists.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.subscriptions("pengwynn")
        a_get("/1/lists/subscriptions.json").
          with(:query => {:screen_name => 'pengwynn', :cursor => "-1"}).
          should have_been_made
      end
      it "should return the lists the specified user follows" do
        subscriptions = @client.subscriptions("pengwynn")
        subscriptions.should be_a Twitter::Cursor
        subscriptions.lists.should be_an Array
        subscriptions.lists.first.should be_an Twitter::List
        subscriptions.lists.first.name.should == "Rubyists"
      end
    end
    context "without a screen name passed" do
      before do
        stub_get("/1/account/verify_credentials.json").
          to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
        stub_get("/1/lists/subscriptions.json").
          with(:query => {:cursor => "-1"}).
          to_return(:body => fixture("lists.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.subscriptions
        a_get("/1/lists/subscriptions.json").
          with(:query => {:cursor => "-1"}).
          should have_been_made
      end
    end
    context "with an Integer user_id passed" do
      before do
        stub_get("/1/lists/subscriptions.json").
          with(:query => {:user_id => '12345678', :cursor => "-1"}).
          to_return(:body => fixture("lists.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.subscriptions(12345678)
        a_get("/1/lists/subscriptions.json").
          with(:query => {:user_id => '12345678', :cursor => "-1"}).
          should have_been_made
      end
    end
  end

  describe ".list_subscribe" do
    context "with a screen name passed" do
      before do
        stub_post("/1/lists/subscribers/create.json").
          with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents'}).
          to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list_subscribe("sferik", "presidents")
        a_post("/1/lists/subscribers/create.json").
          with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents'}).
          should have_been_made
      end
      it "should return the specified list" do
        list = @client.list_subscribe("sferik", "presidents")
        list.should be_a Twitter::List
        list.name.should == "presidents"
      end
    end
    context "with an Integer user_id passed" do
      before do
        stub_post("/1/lists/subscribers/create.json").
          with(:body => {:owner_id => '12345678', :slug => 'presidents'}).
          to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list_subscribe(12345678, "presidents")
        a_post("/1/lists/subscribers/create.json").
          with(:body => {:owner_id => '12345678', :slug => 'presidents'}).
          should have_been_made
      end
    end
    context "with an Integer list_id passed" do
      before do
        stub_post("/1/lists/subscribers/create.json").
          with(:body => {:owner_screen_name => 'sferik', :list_id => '12345678'}).
          to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list_subscribe('sferik', 12345678)
        a_post("/1/lists/subscribers/create.json").
          with(:body => {:owner_screen_name => 'sferik', :list_id => '12345678'}).
          should have_been_made
      end
    end
    context "without a screen name passed" do
      before do
        stub_get("/1/account/verify_credentials.json").
          to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
        stub_post("/1/lists/subscribers/create.json").
          with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents'}).
          to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list_subscribe("presidents")
        a_post("/1/lists/subscribers/create.json").
          with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents'}).
          should have_been_made
      end
    end
  end

  describe ".list_subscriber?" do
    context "with a screen name passed" do
      before do
        stub_get("/1/lists/subscribers/show.json").
          with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => '813286'}).
          to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
        stub_get("/1/lists/subscribers/show.json").
          with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => '18755393'}).
          to_return(:body => fixture("not_found.json"), :status => 404, :headers => {:content_type => "application/json; charset=utf-8"})
        stub_get("/1/lists/subscribers/show.json").
          with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => '12345678'}).
          to_return(:body => fixture("not_found.json"), :status => 403, :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list_subscriber?("sferik", "presidents", 813286)
        a_get("/1/lists/subscribers/show.json").
          with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => '813286'}).
          should have_been_made
      end
      it "should return true if the specified user subscribes to the specified list" do
        list_subscriber = @client.list_subscriber?("sferik", "presidents", 813286)
        list_subscriber.should be_true
      end
      it "should return false if the specified user does not subscribe to the specified list" do
        list_subscriber = @client.list_subscriber?("sferik", "presidents", 18755393)
        list_subscriber.should be_false
      end
      it "should return false if user does not exist" do
        list_subscriber = @client.list_subscriber?("sferik", "presidents", 12345678)
        list_subscriber.should be_false
      end
    end
    context "with an Integer owner_id passed" do
      before do
        stub_get("/1/lists/subscribers/show.json").
          with(:query => {:owner_id => '12345678', :slug => 'presidents', :user_id => '813286'}).
          to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list_subscriber?(12345678, "presidents", 813286)
        a_get("/1/lists/subscribers/show.json").
          with(:query => {:owner_id => '12345678', :slug => 'presidents', :user_id => '813286'}).
          should have_been_made
      end
    end
    context "with an Integer list_id passed" do
      before do
        stub_get("/1/lists/subscribers/show.json").
          with(:query => {:owner_screen_name => 'sferik', :list_id => '12345678', :user_id => '813286'}).
          to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list_subscriber?('sferik', 12345678, 813286)
        a_get("/1/lists/subscribers/show.json").
          with(:query => {:owner_screen_name => 'sferik', :list_id => '12345678', :user_id => '813286'}).
          should have_been_made
      end
    end
    context "with a screen name passed for user_to_check" do
      before do
        stub_get("/1/lists/subscribers/show.json").
          with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :screen_name => 'erebor'}).
          to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list_subscriber?("sferik", "presidents", 'erebor')
        a_get("/1/lists/subscribers/show.json").
          with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :screen_name => 'erebor'}).
          should have_been_made
      end
    end
    context "without a screen name passed" do
      before do
        stub_get("/1/account/verify_credentials.json").
          to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
        stub_get("/1/lists/subscribers/show.json").
          with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => '813286'}).
          to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list_subscriber?("presidents", 813286)
        a_get("/1/lists/subscribers/show.json").
          with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => '813286'}).
          should have_been_made
      end
    end
  end

  describe ".list_unsubscribe" do
    context "with a screen name passed" do
      before do
        stub_post("/1/lists/subscribers/destroy.json").
          with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents'}).
          to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list_unsubscribe("sferik", "presidents")
        a_post("/1/lists/subscribers/destroy.json").
          with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents'}).
          should have_been_made
      end
      it "should return the specified list" do
        list = @client.list_unsubscribe("sferik", "presidents")
        list.should be_a Twitter::List
        list.name.should == "presidents"
      end
    end
    context "with an Integer user_id passed" do
      before do
        stub_post("/1/lists/subscribers/destroy.json").
          with(:body => {:owner_id => '12345678', :slug => 'presidents'}).
          to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list_unsubscribe(12345678, "presidents")
        a_post("/1/lists/subscribers/destroy.json").
          with(:body => {:owner_id => '12345678', :slug => 'presidents'}).
          should have_been_made
      end
    end
    context "with an Integer list_id passed" do
      before do
        stub_post("/1/lists/subscribers/destroy.json").
          with(:body => {:owner_screen_name => 'sferik', :list_id => '12345678'}).
          to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list_unsubscribe('sferik', 12345678)
        a_post("/1/lists/subscribers/destroy.json").
          with(:body => {:owner_screen_name => 'sferik', :list_id => '12345678'}).
          should have_been_made
      end
    end
    context "without a screen name passed" do
      before do
        stub_get("/1/account/verify_credentials.json").
          to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
        stub_post("/1/lists/subscribers/destroy.json").
          with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents'}).
          to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list_unsubscribe("presidents")
        a_post("/1/lists/subscribers/destroy.json").
          with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents'}).
          should have_been_made
      end
    end
  end

  describe ".list_add_members" do
    context "with a screen name passed" do
      before do
        stub_post("/1/lists/members/create_all.json").
          with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => "813286,18755393"}).
          to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list_add_members("sferik", "presidents", [813286, 18755393])
        a_post("/1/lists/members/create_all.json").
          with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => "813286,18755393"}).
          should have_been_made
      end
      it "should return the list" do
        list = @client.list_add_members("sferik", "presidents", [813286, 18755393])
        list.should be_a Twitter::List
        list.name.should == "presidents"
      end
    end
    context "with an Integer user_id passed" do
      before do
        stub_post("/1/lists/members/create_all.json").
          with(:body => {:owner_id => '12345678', :slug => 'presidents', :user_id => "813286,18755393"}).
          to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list_add_members(12345678, "presidents", [813286, 18755393])
        a_post("/1/lists/members/create_all.json").
          with(:body => {:owner_id => '12345678', :slug => 'presidents', :user_id => "813286,18755393"}).
          should have_been_made
      end
    end
    context "with an Integer list_id passed" do
      before do
        stub_post("/1/lists/members/create_all.json").
          with(:body => {:owner_screen_name => 'sferik', :list_id => '12345678', :user_id => "813286,18755393"}).
          to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list_add_members('sferik', 12345678, [813286, 18755393])
        a_post("/1/lists/members/create_all.json").
          with(:body => {:owner_screen_name => 'sferik', :list_id => '12345678', :user_id => "813286,18755393"}).
          should have_been_made
      end
    end
    context "with a combination of member IDs and member screen names to add" do
      before do
        stub_post("/1/lists/members/create_all.json").
          with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => "813286,18755393", :screen_name => "pengwynn,erebor"}).
          to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list_add_members('sferik', 'presidents', [813286, 'pengwynn', 18755393, 'erebor'])
        a_post("/1/lists/members/create_all.json").
          with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => "813286,18755393", :screen_name => "pengwynn,erebor"}).
          should have_been_made
      end
    end
    context "without a screen name passed" do
      before do
        stub_get("/1/account/verify_credentials.json").
          to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
        stub_post("/1/lists/members/create_all.json").
          with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => "813286,18755393"}).
          to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list_add_members("presidents", [813286, 18755393])
        a_post("/1/lists/members/create_all.json").
          with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => "813286,18755393"}).
          should have_been_made
      end
    end
  end

  describe ".list_remove_members" do
    context "with a screen name passed" do
      before do
        stub_post("/1/lists/members/destroy_all.json").
          with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => "813286,18755393"}).
          to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list_remove_members("sferik", "presidents", [813286, 18755393])
        a_post("/1/lists/members/destroy_all.json").
          with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => "813286,18755393"}).
          should have_been_made
      end
      it "should return the list" do
        list = @client.list_remove_members("sferik", "presidents", [813286, 18755393])
        list.should be_a Twitter::List
        list.name.should == "presidents"
      end
    end
    context "with an Integer user_id passed" do
      before do
        stub_post("/1/lists/members/destroy_all.json").
          with(:body => {:owner_id => '12345678', :slug => 'presidents', :user_id => "813286,18755393"}).
          to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list_remove_members(12345678, "presidents", [813286, 18755393])
        a_post("/1/lists/members/destroy_all.json").
          with(:body => {:owner_id => '12345678', :slug => 'presidents', :user_id => "813286,18755393"}).
          should have_been_made
      end
    end
    context "with an Integer list_id passed" do
      before do
        stub_post("/1/lists/members/destroy_all.json").
          with(:body => {:owner_screen_name => 'sferik', :list_id => '12345678', :user_id => "813286,18755393"}).
          to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list_remove_members('sferik', 12345678, [813286, 18755393])
        a_post("/1/lists/members/destroy_all.json").
          with(:body => {:owner_screen_name => 'sferik', :list_id => '12345678', :user_id => "813286,18755393"}).
          should have_been_made
      end
    end
    context "with a combination of member IDs and member screen names to add" do
      before do
        stub_post("/1/lists/members/destroy_all.json").
          with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => "813286,18755393", :screen_name => "pengwynn,erebor"}).
          to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list_remove_members('sferik', 'presidents', [813286, 'pengwynn', 18755393, 'erebor'])
        a_post("/1/lists/members/destroy_all.json").
          with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => "813286,18755393", :screen_name => "pengwynn,erebor"}).
          should have_been_made
      end
    end
    context "without a screen name passed" do
      before do
        stub_get("/1/account/verify_credentials.json").
          to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
        stub_post("/1/lists/members/destroy_all.json").
          with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => "813286,18755393"}).
          to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list_remove_members("presidents", [813286, 18755393])
        a_post("/1/lists/members/destroy_all.json").
          with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => "813286,18755393"}).
          should have_been_made
      end
    end
  end

  describe ".list_member?" do
    context "with a screen name passed" do
      before do
        stub_get("/1/lists/members/show.json").
          with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => '813286'}).
          to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
        stub_get("/1/lists/members/show.json").
          with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => '65493023'}).
          to_return(:body => fixture("not_found.json"), :status => 404, :headers => {:content_type => "application/json; charset=utf-8"})
        stub_get("/1/lists/members/show.json").
          with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => '12345678'}).
          to_return(:body => fixture("not_found.json"), :status => 403, :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list_member?("sferik", "presidents", 813286)
        a_get("/1/lists/members/show.json").
          with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => '813286'}).
          should have_been_made
      end
      it "should return true if user is a list member" do
        list_member = @client.list_member?("sferik", "presidents", 813286)
        list_member.should be_true
      end
      it "should return false if user is not a list member" do
        list_member = @client.list_member?("sferik", "presidents", 65493023)
        list_member.should be_false
      end
      it "should return false if user does not exist" do
        list_member = @client.list_member?("sferik", "presidents", 12345678)
        list_member.should be_false
      end
    end
    context "with an Integer owner_id passed" do
      before do
        stub_get("/1/lists/members/show.json").
          with(:query => {:owner_id => '12345678', :slug => 'presidents', :user_id => '813286'}).
          to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list_member?(12345678, "presidents", 813286)
        a_get("/1/lists/members/show.json").
          with(:query => {:owner_id => '12345678', :slug => 'presidents', :user_id => '813286'}).
          should have_been_made
      end
    end
    context "with an Integer list_id passed" do
      before do
        stub_get("/1/lists/members/show.json").
          with(:query => {:owner_screen_name => 'sferik', :list_id => '12345678', :user_id => '813286'}).
          to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list_member?('sferik', 12345678, 813286)
        a_get("/1/lists/members/show.json").
          with(:query => {:owner_screen_name => 'sferik', :list_id => '12345678', :user_id => '813286'}).
          should have_been_made
      end
    end
    context "with a screen name passed for user_to_check" do
      before do
        stub_get("/1/lists/members/show.json").
          with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :screen_name => 'erebor'}).
          to_return(:body => fixture("list.json"), :headers => {:content_type => "application/.json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list_member?("sferik", "presidents", 'erebor')
        a_get("/1/lists/members/show.json").
          with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :screen_name => 'erebor'}).
          should have_been_made
      end
    end
    context "without a screen name passed" do
      before do
        stub_get("/1/account/verify_credentials.json").
          to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
        stub_get("/1/lists/members/show.json").
          with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => '813286'}).
          to_return(:body => fixture("list.json"), :headers => {:content_type => "application/.json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list_member?("presidents", 813286)
        a_get("/1/lists/members/show.json").
          with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => '813286'}).
          should have_been_made
      end
    end
  end

  describe ".list_members" do
    context "with a screen name passed" do
      before do
        stub_get("/1/lists/members.json").
          with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :cursor => "-1"}).
          to_return(:body => fixture("users_list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list_members("sferik", "presidents")
        a_get("/1/lists/members.json").
          with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :cursor => "-1"}).
          should have_been_made
      end
      it "should return the members of the specified list" do
        list_members = @client.list_members("sferik", "presidents")
        list_members.should be_a Twitter::Cursor
        list_members.users.should be_an Array
        list_members.users.first.should be_a Twitter::User
        list_members.users.first.name.should == "Erik Michaels-Ober"
      end
    end
    context "with an Integer user_id passed" do
      before do
        stub_get("/1/lists/members.json").
          with(:query => {:owner_id => '12345678', :slug => 'presidents', :cursor => "-1"}).
          to_return(:body => fixture("users_list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list_members(12345678, 'presidents')
        a_get("/1/lists/members.json").
          with(:query => {:owner_id => '12345678', :slug => 'presidents', :cursor => "-1"}).
          should have_been_made
      end
    end
    context "without a screen name passed" do
      before do
        stub_get("/1/account/verify_credentials.json").
          to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
        stub_get("/1/lists/members.json").
          with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :cursor => "-1"}).
          to_return(:body => fixture("users_list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list_members("presidents")
        a_get("/1/lists/members.json").
          with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :cursor => "-1"}).
          should have_been_made
      end
    end
  end

  describe ".list_add_member" do
    context "with a screen name passed" do
      before do
        stub_post("/1/lists/members/create.json").
          with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => "813286"}).
          to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list_add_member("sferik", "presidents", 813286)
        a_post("/1/lists/members/create.json").
          with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => "813286"}).
          should have_been_made
      end
      it "should return the list" do
        list = @client.list_add_member("sferik", "presidents", 813286)
        list.should be_a Twitter::List
        list.name.should == "presidents"
      end
    end
    context "with an Integer user_id passed" do
      before do
        stub_post("/1/lists/members/create.json").
          with(:body => {:owner_id => '12345678', :slug => 'presidents', :user_id => "813286"}).
          to_return(:body => fixture("users_list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list_add_member(12345678, 'presidents', 813286)
        a_post("/1/lists/members/create.json").
          with(:body => {:owner_id => '12345678', :slug => 'presidents', :user_id => "813286"}).
          should have_been_made
      end
    end
    context "with an Integer list_id passed" do
      before do
        stub_post("/1/lists/members/create.json").
          with(:body => {:owner_screen_name => 'sferik', :list_id => '12345678', :user_id => "813286"}).
          to_return(:body => fixture("users_list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list_add_member('sferik', 12345678, 813286)
        a_post("/1/lists/members/create.json").
          with(:body => {:owner_screen_name => 'sferik', :list_id => '12345678', :user_id => "813286"}).
          should have_been_made
      end
    end
    context "without a screen name passed" do
      before do
        stub_get("/1/account/verify_credentials.json").
          to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
        stub_post("/1/lists/members/create.json").
          with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => "813286"}).
          to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list_add_member("presidents", 813286)
        a_post("/1/lists/members/create.json").
          with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents', :user_id => "813286"}).
          should have_been_made
      end
    end
  end

  describe ".list_destroy" do
    context "with a screen name passed" do
      before do
        stub_delete("/1/lists/destroy.json").
          with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents'}).
          to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list_destroy("sferik", "presidents")
        a_delete("/1/lists/destroy.json").
          with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents'}).
          should have_been_made
      end
      it "should return the deleted list" do
        list = @client.list_destroy("sferik", "presidents")
        list.should be_a Twitter::List
        list.name.should == "presidents"
      end
    end
    context "without a screen name passed" do
      before do
        stub_get("/1/account/verify_credentials.json").
          to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
        stub_delete("/1/lists/destroy.json").
          with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents'}).
          to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list_destroy("presidents")
        a_delete("/1/lists/destroy.json").
          with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents'}).
          should have_been_made
      end
    end
    context "with an Integer list_id passed" do
      before do
        stub_delete("/1/lists/destroy.json").
          with(:query => {:owner_screen_name => 'sferik', :list_id => '12345678'}).
          to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list_destroy("sferik", 12345678)
        a_delete("/1/lists/destroy.json").
          with(:query => {:owner_screen_name => 'sferik', :list_id => '12345678'}).
          should have_been_made
      end
    end
    context "with an Integer user_id passed" do
      before do
        stub_delete("/1/lists/destroy.json").
          with(:query => {:owner_id => '12345678', :slug => 'presidents'}).
          to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list_destroy(12345678, 'presidents')
        a_delete("/1/lists/destroy.json").
          with(:query => {:owner_id => '12345678', :slug => 'presidents'}).
          should have_been_made
      end
    end
  end

  describe ".list_update" do
    context "with a screen name passed" do
      before do
        stub_post("/1/lists/update.json").
          with(:body => {:owner_screen_name => 'sferik', :slug => "presidents", :description => "Presidents of the United States of America"}).
          to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list_update("sferik", "presidents", :description => "Presidents of the United States of America")
        a_post("/1/lists/update.json").
          with(:body => {:owner_screen_name => 'sferik', :slug => "presidents", :description => "Presidents of the United States of America"}).
          should have_been_made
      end
      it "should return the updated list" do
        list = @client.list_update("sferik", "presidents", :description => "Presidents of the United States of America")
        list.should be_a Twitter::List
        list.name.should == "presidents"
      end
    end
    context "without a screen name passed" do
      before do
        stub_get("/1/account/verify_credentials.json").
          to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
        stub_post("/1/lists/update.json").
          with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents', :description => "Presidents of the United States of America"}).
          to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list_update("presidents", :description => "Presidents of the United States of America")
        a_post("/1/lists/update.json").
          with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents', :description => "Presidents of the United States of America"}).
          should have_been_made
      end
    end
    context "with an Integer list_id passed" do
      before do
        stub_post("/1/lists/update.json").
          with(:body => {:owner_screen_name => 'sferik', :list_id => '12345678', :description => "Presidents of the United States of America"}).
          to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list_update("sferik", 12345678, :description => "Presidents of the United States of America")
        a_post("/1/lists/update.json").
          with(:body => {:owner_screen_name => 'sferik', :list_id => '12345678', :description => "Presidents of the United States of America"}).
          should have_been_made
      end
    end
    context "with an Integer user_id passed" do
      before do
        stub_post("/1/lists/update.json").
          with(:body => {:owner_id => '12345678', :slug => 'presidents', :description => "Presidents of the United States of America"}).
          to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list_update(12345678, 'presidents', :description => "Presidents of the United States of America")
        a_post("/1/lists/update.json").
          with(:body => {:owner_id => '12345678', :slug => 'presidents', :description => "Presidents of the United States of America"}).
          should have_been_made
      end
    end
  end

  describe ".list_create" do
    before do
      stub_post("/1/lists/create.json").
        with(:body => {:name => "presidents"}).
        to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
    end
    it "should request the correct resource" do
      @client.list_create("presidents")
      a_post("/1/lists/create.json").
        with(:body => {:name => "presidents"}).
        should have_been_made
    end
    it "should return the created list" do
      list = @client.list_create("presidents")
      list.should be_a Twitter::List
      list.name.should == "presidents"
    end
  end

  describe ".lists" do
    context "with a screen name passed" do
      before do
        stub_get("/1/lists.json").
          with(:query => {:screen_name => 'sferik', :cursor => "-1"}).
          to_return(:body => fixture("lists.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.lists("sferik")
        a_get("/1/lists.json").
          with(:query => {:screen_name => 'sferik', :cursor => "-1"}).
          should have_been_made
      end
      it "should return the updated list" do
        lists = @client.lists("sferik")
        lists.should be_a Twitter::Cursor
        lists.lists.should be_an Array
        lists.lists.first.should be_an Twitter::List
        lists.lists.first.name.should == "Rubyists"
      end
    end
    context "with an Integer user id passed" do
      before do
        stub_get("/1/lists.json").
          with(:query => {:user_id => '12345678', :cursor => "-1"}).
          to_return(:body => fixture("lists.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.lists(12345678)
        a_get("/1/lists.json").
          with(:query => {:user_id => '12345678', :cursor => "-1"}).
          should have_been_made
      end
      it "should return the updated list" do
        lists = @client.lists(12345678)
        lists.should be_a Twitter::Cursor
        lists.lists.should be_an Array
        lists.lists.first.should be_an Twitter::List
        lists.lists.first.name.should == "Rubyists"
      end
    end
    context "without arguments passed" do
      before do
        stub_get("/1/lists.json").
          with(:query => {:cursor => "-1"}).
          to_return(:body => fixture("lists.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.lists
        a_get("/1/lists.json").
          with(:query => {:cursor => "-1"}).
          should have_been_made
      end
      it "should return the updated list" do
        lists = @client.lists
        lists.should be_a Twitter::Cursor
        lists.lists.should be_an Array
        lists.lists.first.should be_an Twitter::List
        lists.lists.first.name.should == "Rubyists"
      end
    end
  end

  describe ".list" do
    context "with a screen name passed" do
      before do
        stub_get("/1/lists/show.json").
          with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents'}).
          to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list("sferik", "presidents")
        a_get("/1/lists/show.json").
          with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents'}).
          should have_been_made
      end
      it "should return the updated list" do
        list = @client.list("sferik", "presidents")
        list.should be_a Twitter::List
        list.name.should == "presidents"
      end
    end
    context "without a screen name passed" do
      before do
        stub_get("/1/account/verify_credentials.json").
          to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
        stub_get("/1/lists/show.json").
          with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents'}).
          to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list("presidents")
        a_get("/1/lists/show.json").
          with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents'}).
          should have_been_made
      end
    end
    context "with an Integer list_id passed" do
      before do
        stub_get("/1/lists/show.json").
          with(:query => {:owner_screen_name => 'sferik', :list_id => '12345678'}).
          to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list("sferik", 12345678)
        a_get("/1/lists/show.json").
          with(:query => {:owner_screen_name => 'sferik', :list_id => '12345678'}).
          should have_been_made
      end
    end
    context "with an Integer user_id passed" do
      before do
        stub_get("/1/lists/show.json").
          with(:query => {:owner_id => '12345678', :slug => 'presidents'}).
          to_return(:body => fixture("list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
      end
      it "should request the correct resource" do
        @client.list(12345678, 'presidents')
        a_get("/1/lists/show.json").
          with(:query => {:owner_id => '12345678', :slug => 'presidents'}).
          should have_been_made
      end
    end
  end

end

redpajama_set_name: RedPajamaGithub


text:
export const convert = () => {
  throw new Error('Remove this statement and implement this function');
};


text:
namespace blink {
namespace web_pref {
struct WebPreferences;
}
}  // namespace blink

namespace content {
class FakeBluetoothChooser;
class FakeBluetoothChooserFactory;
class FakeBluetoothDelegate;
class MockBadgeService;
class MockClipboardHost;
class WebTestBrowserContext;

class WebTestContentBrowserClient : public ShellContentBrowserClient {
 public:
  // Gets the current instance.
  static WebTestContentBrowserClient* Get();

  WebTestContentBrowserClient();
  ~WebTestContentBrowserClient() override;

  WebTestBrowserContext* GetWebTestBrowserContext();
  void SetPopupBlockingEnabled(bool block_popups_);
  void ResetMockClipboardHosts();
  void SetScreenOrientationChanged(bool screen_orientation_changed);

  // Retrieves the last created FakeBluetoothChooser instance.
  std::unique_ptr<FakeBluetoothChooser> GetNextFakeBluetoothChooser();
  void ResetFakeBluetoothDelegate();

  // ContentBrowserClient overrides.
  void BrowserChildProcessHostCreated(BrowserChildProcessHost* host) override;
  void ExposeInterfacesToRenderer(
      service_manager::BinderRegistry* registry,
      blink::AssociatedInterfaceRegistry* associated_registry,
      RenderProcessHost* render_process_host) override;
  void OverrideWebkitPrefs(WebContents* web_contents,
                           blink::web_pref::WebPreferences* prefs) override;
  void AppendExtraCommandLineSwitches(base::CommandLine* command_line,
                                      int child_process_id) override;
  std::unique_ptr<BrowserMainParts> CreateBrowserMainParts(
      bool is_integration_test) override;
  std::vector<url::Origin> GetOriginsRequiringDedicatedProcess() override;
  std::unique_ptr<VideoOverlayWindow> CreateWindowForVideoPictureInPicture(
      VideoPictureInPictureWindowController* controller) override;
  bool CanCreateWindow(content::RenderFrameHost* opener,
                       const GURL& opener_url,
                       const GURL& opener_top_level_frame_url,
                       const url::Origin& source_origin,
                       content::mojom::WindowContainerType container_type,
                       const GURL& target_url,
                       const content::Referrer& referrer,
                       const std::string& frame_name,
                       WindowOpenDisposition disposition,
                       const blink::mojom::WindowFeatures& features,
                       bool user_gesture,
                       bool opener_suppressed,
                       bool* no_javascript_access) override;
  void RegisterBrowserInterfaceBindersForFrame(
      RenderFrameHost* render_frame_host,
      mojo::BinderMapWithContext<content::RenderFrameHost*>* map) override;
  bool CanAcceptUntrustedExchangesIfNeeded() override;
  BluetoothDelegate* GetBluetoothDelegate() override;
  content::TtsPlatform* GetTtsPlatform() override;
  bool CanEnterFullscreenWithoutUserActivation() override;
  std::unique_ptr<LoginDelegate> CreateLoginDelegate(
      const net::AuthChallengeInfo& auth_info,
      content::WebContents* web_contents,
      const content::GlobalRequestID& request_id,
      bool is_request_for_primary_main_frame,
      const GURL& url,
      scoped_refptr<net::HttpResponseHeaders> response_headers,
      bool first_auth_attempt,
      LoginAuthRequiredCallback auth_required_callback) override;
#if BUILDFLAG(IS_WIN)
  bool PreSpawnChild(sandbox::TargetPolicy* policy,
                     sandbox::mojom::Sandbox sandbox_type,
                     ChildSpawnFlags flags) override;
#endif
  std::string GetAcceptLangs(BrowserContext* context) override;
  bool IsInterestGroupAPIAllowed(content::RenderFrameHost* render_frame_host,
                                 InterestGroupApiOperation operation,
                                 const url::Origin& top_frame_origin,
                                 const url::Origin& api_origin) override;
  void GetHyphenationDictionary(
      base::OnceCallback<void(const base::FilePath&)>) override;

 private:
  // ShellContentBrowserClient overrides.
  void ConfigureNetworkContextParamsForShell(
      BrowserContext* context,
      network::mojom::NetworkContextParams* context_params,
      cert_verifier::mojom::CertVerifierCreationParams*
          cert_verifier_creation_params) override;

  // Creates and stores a FakeBluetoothChooserFactory instance.
  void CreateFakeBluetoothChooserFactory(
      mojo::PendingReceiver<mojom::FakeBluetoothChooserFactory> receiver);
  void BindClipboardHost(
      RenderFrameHost* render_frame_host,
      mojo::PendingReceiver<blink::mojom::ClipboardHost> receiver);

  void BindBadgeService(
      RenderFrameHost* render_frame_host,
      mojo::PendingReceiver<blink::mojom::BadgeService> receiver);

  void BindPermissionAutomation(
      mojo::PendingReceiver<blink::test::mojom::PermissionAutomation> receiver);

  void BindStorageAccessAutomation(
      mojo::PendingReceiver<blink::test::mojom::StorageAccessAutomation>
          receiver);

  void BindCookieManagerAutomation(
      RenderFrameHost* render_frame_host,
      mojo::PendingReceiver<blink::test::mojom::CookieManagerAutomation>
          receiver);

  void BindAttributionReportingAutomation(
      RenderFrameHost* render_frame_host,
      mojo::PendingReceiver<blink::test::mojom::AttributionReportingAutomation>
          receiver);

  void BindWebTestControlHost(
      int render_process_id,
      mojo::PendingAssociatedReceiver<mojom::WebTestControlHost> receiver);

  bool block_popups_ = true;
  bool screen_orientation_changed_ = false;

  // Stores the FakeBluetoothChooserFactory that produces FakeBluetoothChoosers.
  std::unique_ptr<FakeBluetoothChooserFactory> fake_bluetooth_chooser_factory_;
  std::unique_ptr<FakeBluetoothDelegate> fake_bluetooth_delegate_;
  std::unique_ptr<MockClipboardHost> mock_clipboard_host_;
  std::unique_ptr<MockBadgeService> mock_badge_service_;
  mojo::UniqueReceiverSet<blink::test::mojom::CookieManagerAutomation>
      cookie_managers_;
  mojo::UniqueReceiverSet<blink::test::mojom::AttributionReportingAutomation>
      attribution_reporting_receivers_;
};

}  // namespace content

#endif  // CONTENT_WEB_TEST_BROWSER_WEB_TEST_CONTENT_BROWSER_CLIENT_H_


text:
"""
py2app/py2exe build script for XBL Growl.

Will automatically ensure that all build prerequisites are available
via ez_setup

Usage (Mac OS X):
    python setup.py py2app

Usage (Windows):
    python setup.py py2exe
"""
import ez_setup
ez_setup.use_setuptools()

import sys
from setuptools import setup

mainscript = 'xblgrowl.py'

if sys.platform == 'darwin':
    options = dict(
        setup_requires=['py2app'],
        app=[mainscript],
        options={
            'py2app': {
                'argv_emulation': True,
                'iconfile': 'xblgrowl.icns',
                'plist': {
                    'LSUIElement': True,
                },
            },
        },
    )
elif sys.platform == 'win32':
    options = dict(
        setup_requires=['py2exe'],
        app=[mainscript],
    )
else:
    options = dict(
        scripts=[mainscript],
    )

setup(
    name='XBL Growl',
    **options
)