spec/client_spec.rb in gmail-0.3.4 vs spec/client_spec.rb in gmail-0.4.0

- old
+ new

@@ -1,9 +1,9 @@ require 'spec_helper' -describe "Gmail client" do - subject { Gmail::Client } +describe "Gmail client (Plain)" do + subject { Gmail::Client::Plain } context "on initialize" do it "should set username, password and options" do client = subject.new("test@gmail.com", "pass", :foo => :bar) client.username.should == "test@gmail.com" @@ -17,11 +17,11 @@ end end context "instance" do def mock_client(&block) - client = Gmail::Client.new(*TEST_ACCOUNT) + client = Gmail::Client::Plain.new(*TEST_ACCOUNT) if block_given? client.connect yield client client.logout end @@ -43,19 +43,19 @@ client.logout end it "should raise error when given GMail account is invalid and errors enabled" do lambda { - client = Gmail::Client.new("foo", "bar") + client = Gmail::Client::Plain.new("foo", "bar") client.connect.should be_true client.login!.should_not be_true }.should raise_error(Gmail::Client::AuthorizationError) end it "shouldn't login when given GMail account is invalid" do lambda { - client = Gmail::Client.new("foo", "bar") + client = Gmail::Client::Plain.new("foo", "bar") client.connect.should be_true client.login.should_not be_true }.should_not raise_error(Gmail::Client::AuthorizationError) end @@ -135,10 +135,10 @@ end end context "labels" do subject { - client = Gmail::Client.new(*TEST_ACCOUNT) + client = Gmail::Client::Plain.new(*TEST_ACCOUNT) client.connect client.labels } it "should get list of all available labels" do