spec/moip2_spec.rb in moip2-0.1.4 vs spec/moip2_spec.rb in moip2-1.0.0
- old
+ new
@@ -1,19 +1,16 @@
describe Moip2 do
-
describe ".new" do
-
let(:auth) do
Moip2::Auth::Basic.new("TOKEN", "SECRET")
end
-
let(:moip) do
described_class.auth = auth
described_class.new
end
-
+
it "creates a new Api using default environment" do
expect(moip.client.env).to eq(:sandbox)
end
it "creates a new Api using defined auth" do
@@ -21,30 +18,26 @@
end
it "creates a new Client" do
expect(moip).to be_a(Moip2::Api)
end
-
+
it "valid_env comparision rails variable" do
- expect{ Moip2.env=(:production) }.not_to raise_error
+ expect { Moip2.env = :production }.not_to raise_error
end
-
+
it "invalid enviroment error" do
- expect{ Moip2.env=("abc") }.to raise_error(Moip2::InvalidEnviromentError)
+ expect { Moip2.env = "abc" }.to raise_error(Moip2::InvalidEnviromentError)
end
-
-
- context "when auth is not set" do
+ context "when auth is not set" do
let(:moip) do
described_class.auth = nil
described_class.new
end
it "raises an error" do
expect { moip }.to raise_error
end
end
-
end
-
end