Skip to content

Commit

Permalink
Use SimpleCov
Browse files Browse the repository at this point in the history
Also, add some tests for extra coverage
  • Loading branch information
robmiller committed Apr 29, 2014
1 parent 05805d5 commit cb468e3
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,2 +1,3 @@
config.yml
Gemfile.lock
coverage
1 change: 1 addition & 0 deletions ruby-wpdb.gemspec
Expand Up @@ -31,6 +31,7 @@ Gem::Specification.new do |s|

s.add_development_dependency 'rspec', '~> 2.14'
s.add_development_dependency 'rack-test', '~> 0.6'
s.add_development_dependency 'simplecov', '~> 0.8'

s.add_development_dependency "guard", "~> 2.6"
s.add_development_dependency "guard-rspec", "~> 4.2"
Expand Down
10 changes: 10 additions & 0 deletions spec/lib/ruby-wpdb/gravityforms_spec.rb
Expand Up @@ -19,9 +19,19 @@ module WPDB
@form.leads.first.details.should_not be_empty
end

it "gets the name of a field" do
@form.stub(:fields).and_return(sample_fields)
@form.field_name(1).should == "First name"
@form.field_name(2).should == "Last name"
end

it "lazily loads models for forms" do
klass = GravityForms.const_get(@class_name)
klass.should be_a(Class)
end

it "raises an error for forms that don't exist" do
expect { GravityForms::AFormThatDoesNotExist }.to raise_error(/Form not found/)
end
end
end
3 changes: 3 additions & 0 deletions spec/spec_helper.rb
Expand Up @@ -5,6 +5,9 @@

require 'sequel'

require 'simplecov'
SimpleCov.start

require 'ruby-wpdb'

WPDB.from_config
Expand Down

0 comments on commit cb468e3

Please sign in to comment.