Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

use described_class method when it possible

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

0 comments on commit f217ee0

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