Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

use described_class method when it possible

  • Loading branch information...
commit f217ee0c73008db6342110359a1caba2d86e67bd 1 parent 65bac9a
@nashby nashby authored
View
5 spec/donors_choose_spec.rb
@@ -1,10 +1,9 @@
-$:.unshift("lib")
require 'donors_choose'
describe DonorsChoose do
it "is able to have an API key set" do
key = "this isn't an API key"
- DonorsChoose.api_key = key
- DonorsChoose.api_key.should eq(key)
+ described_class.api_key = key
+ described_class.api_key.should eq(key)
end
end
View
5 spec/project_spec.rb
@@ -1,4 +1,3 @@
-$:.unshift("lib")
require 'donors_choose'
describe DonorsChoose::Project do
@@ -10,7 +9,7 @@
with(:centerLat => "40.4405556", :centerLong => "-79.9961111").
and_return(projects)
- results = DonorsChoose::Project.near_me("40.4405556", "-79.9961111")
+ results = described_class.near_me("40.4405556", "-79.9961111")
results.should eq(projects)
end
@@ -20,7 +19,7 @@
with(:zip => "15232").
and_return(projects)
- results = DonorsChoose::Project.by_zip("15232")
+ results = described_class.by_zip("15232")
results.should eq(projects)
end
end
View
6 spec/request_spec.rb
@@ -1,8 +1,8 @@
-$:.unshift("lib")
require 'donors_choose/request'
require 'vcr'
require 'webmock'
+
YAML_SERIALIZATION_VERSION = RUBY_VERSION =~ /1\.8/ ? '1.8' : 'not_1.8'
VCR.config do |c|
c.cassette_library_dir = File.join(File.dirname(__FILE__), '..', 'cassettes', YAML_SERIALIZATION_VERSION)
@@ -19,8 +19,8 @@
it "is able to request data from the API" do
DonorsChoose.api_key = "DONORSCHOOSE"
- request = DonorsChoose::Request.new({:state => "NC",
- :community => "1007:3"})
+ request = described_class.new({:state => "NC",
+ :community => "1007:3"})
request.process.should_not be_nil
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.