spec/pagseguro/pagseguro_spec.rb in pagseguro-0.1.10 vs spec/pagseguro/pagseguro_spec.rb in pagseguro-0.1.11.beta1

- old
+ new

@@ -3,12 +3,12 @@ describe PagSeguro do describe "configuration" do before do @config_file = Rails.root.join("config/pagseguro.yml") @contents = YAML.load_file(@config_file) - File.stub!(:exists?).and_return(true) - YAML.stub!(:load_file).and_return(@contents) + File.stub :exists? => true + YAML.stub :load_file => @contents module PagSeguro; @@config = nil; end end it "should raise error if configuration is not found" do @@ -32,17 +32,17 @@ PagSeguro.gateway_url.should == "/pagseguro_developer" end it "should return real url if developer mode is disabled" do PagSeguro.should_receive(:developer?).and_return(false) - PagSeguro.gateway_url.should == "https://pagseguro.uol.com.br/security/webpagamentos/webpagto.aspx" + PagSeguro.gateway_url.should == "https://pagseguro.uol.com.br/pagseguro-ws/checkout/NPI.jhtml" end it "should read configuration developer mode" do - PagSeguro.stub!(:config).and_return("developer" => true) + PagSeguro.stub :config => {"developer" => true} PagSeguro.should be_developer - PagSeguro.stub!(:config).and_return("developer" => false) + PagSeguro.stub :config => {"developer" => false} PagSeguro.should_not be_developer end end end \ No newline at end of file