Skip to content
Browse files

Adding rspec and guard to do some BDD

  • Loading branch information...
0 parents commit 6c42a94ebbc64404fc3979bd0b09cf54f3b3b971 @teonimesic teonimesic committed
Showing with 77 additions and 0 deletions.
  1. +5 −0 .gitignore
  2. +1 −0 .rspec
  3. +10 −0 Gemfile
  4. +5 −0 Guardfile
  5. +20 −0 PagSeguro.gemspec
  6. +1 −0 Rakefile
  7. +7 −0 lib/pag_seguro.rb
  8. +7 −0 lib/pag_seguro/payment.rb
  9. +3 −0 lib/pag_seguro/version.rb
  10. +7 −0 spec/pag_seguro/payment_spec.rb
  11. +7 −0 spec/pag_seguro/version_spec.rb
  12. +4 −0 spec/spec_helper.rb
5 .gitignore
@@ -0,0 +1,5 @@
+*.gem
+.bundle
+Gemfile.lock
+pkg/*
+coverage/*
1 .rspec
@@ -0,0 +1 @@
+--color
10 Gemfile
@@ -0,0 +1,10 @@
+source "http://rubygems.org"
+
+# Specify your gem's dependencies in PagSeguro.gemspec
+gemspec
+
+# test gems
+gem 'rspec'
+gem 'simplecov', require: false
+gem 'guard-rspec'
+gem 'growl'
5 Guardfile
@@ -0,0 +1,5 @@
+guard 'rspec', version: 2 do
+ watch(%r{^spec/.+_spec\.rb})
+ watch(%r{^lib/(.+)\.rb}) { |m| "spec/#{m[1]}_spec.rb" }
+ watch('spec/spec_helper.rb') { "spec" }
+end
20 PagSeguro.gemspec
@@ -0,0 +1,20 @@
+# -*- encoding: utf-8 -*-
+$:.push File.expand_path("../lib", __FILE__)
+require "pag_seguro/version"
+
+Gem::Specification.new do |s|
+ s.name = "PagSeguro"
+ s.version = PagSeguro::VERSION
+ s.authors = ["Stefano Diem Benatti"]
+ s.email = ["stefano.diem@gmail.com"]
+ s.homepage = ""
+ s.summary = %q{TODO: Write a gem summary}
+ s.description = %q{TODO: Write a gem description}
+
+ s.rubyforge_project = "PagSeguro"
+
+ s.files = `git ls-files`.split("\n")
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
+ s.require_paths = ["lib"]
+end
1 Rakefile
@@ -0,0 +1 @@
+require 'bundler/gem_tasks'
7 lib/pag_seguro.rb
@@ -0,0 +1,7 @@
+$: << "lib/pag_seguro"
+
+require "payment"
+require "version"
+
+module PagSeguro
+end
7 lib/pag_seguro/payment.rb
@@ -0,0 +1,7 @@
+require "net/https"
+
+module PagSeguro
+ class Payment
+ BASE_URL = 'ws.pagseguro.uol.com.br/v2/checkout'
+ end
+end
3 lib/pag_seguro/version.rb
@@ -0,0 +1,3 @@
+module PagSeguro
+ VERSION = "0.0.1"
+end
7 spec/pag_seguro/payment_spec.rb
@@ -0,0 +1,7 @@
+require 'spec_helper'
+
+describe PagSeguro::Payment do
+ it "should have a base url to 'ws.pagseguro.uol.com.br/v2/checkout'" do
+ PagSeguro::Payment::BASE_URL.should == 'ws.pagseguro.uol.com.br/v2/checkout'
+ end
+end
7 spec/pag_seguro/version_spec.rb
@@ -0,0 +1,7 @@
+require 'spec_helper'
+
+describe PagSeguro do
+ it "should have a version" do
+ PagSeguro::VERSION.should_not be_empty
+ end
+end
4 spec/spec_helper.rb
@@ -0,0 +1,4 @@
+require 'simplecov'
+SimpleCov.start
+
+require File.dirname(__FILE__) + "/../lib/pag_seguro"

0 comments on commit 6c42a94

Please sign in to comment.
Something went wrong with that request. Please try again.