Skip to content

Commit

Permalink
Starts specs for the gem for testing and stability. @todo make these …
Browse files Browse the repository at this point in the history
…specs actually do something.
  • Loading branch information
Stephen Reid committed May 11, 2016
1 parent 45f977f commit d094003
Show file tree
Hide file tree
Showing 6 changed files with 179 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
require "bundler/gem_tasks"

Bundler::GemHelper.install_tasks


require 'rspec/core'
require 'rspec/core/rake_task'

desc "Run all specs"
RSpec::Core::RakeTask.new(:spec) do |t|
t.pattern = "./spec/**/*_spec.rb"
end
15 changes: 15 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
require 'rubygems'
# Need active support for to_json and symbolize_keys!
require 'active_support/all'

# Require webmock and VCR to test requests
require 'webmock/rspec'
require 'vcr'

require 'rspec'
require 'ttdrest'

VCR.configure do |c|
c.cassette_library_dir = "spec/vcr"
c.hook_into :webmock
end
7 changes: 7 additions & 0 deletions spec/ttdrest/client_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe Ttdrest::Client do
it 'can initialize' do
expect(Ttdrest::Client.new).to be_an_instance_of(Ttdrest::Client)
end
end
13 changes: 13 additions & 0 deletions spec/ttdrest/concerns/creative_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe Ttdrest::Client do
describe "with initialized client" do
let(:client) { Ttdrest::Client.new }

it '#get_creatives' do
VCR.use_cassette('get_creatives') do
expect(client.get_creatives).to eq nil
end
end
end
end
132 changes: 132 additions & 0 deletions spec/vcr/get_creatives.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions ttdrest.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@ Gem::Specification.new do |spec|

spec.add_development_dependency "bundler", "~> 1.6"
spec.add_development_dependency "rake"
spec.add_development_dependency "vcr"
spec.add_development_dependency "webmock"
end

0 comments on commit d094003

Please sign in to comment.