smg 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +1 -1
- data/lib/smg/http.rb +23 -24
- data/lib/smg/http/exceptions.rb +5 -9
- data/lib/smg/http/hooks.rb +43 -0
- data/lib/smg/http/request.rb +23 -2
- data/lib/smg/mapping.rb +1 -3
- data/lib/smg/mapping/element.rb +1 -5
- data/lib/smg/mapping/typecasts.rb +1 -1
- data/lib/smg/model.rb +4 -4
- data/lib/smg/version.rb +1 -1
- metadata +32 -37
- data/examples/crazy.rb +0 -37
- data/examples/discogs/label.rb +0 -62
- data/examples/discogs/search.rb +0 -60
- data/examples/helper.rb +0 -10
- data/examples/plant.rb +0 -88
- data/examples/twitter.rb +0 -38
- data/examples/weather.rb +0 -147
- data/spec/collect_spec.rb +0 -272
- data/spec/context_spec.rb +0 -189
- data/spec/extract_spec.rb +0 -219
- data/spec/filtering_spec.rb +0 -164
- data/spec/fixtures/discogs/948224.xml +0 -1
- data/spec/fixtures/discogs/Enzyme+Records.xml +0 -9
- data/spec/fixtures/discogs/Genosha+Recordings.xml +0 -13
- data/spec/fixtures/discogs/Ophidian.xml +0 -6
- data/spec/fixtures/fake/malus.xml +0 -18
- data/spec/fixtures/fake/valve.xml +0 -8
- data/spec/fixtures/twitter/pipopolam.xml +0 -46
- data/spec/fixtures/yahoo.weather.com.xml +0 -50
- data/spec/http/request_spec.rb +0 -186
- data/spec/http/shared/automatic.rb +0 -43
- data/spec/http/shared/non_automatic.rb +0 -36
- data/spec/http/shared/redirectable.rb +0 -30
- data/spec/http_spec.rb +0 -76
- data/spec/lib/helpers/http_helpers.rb +0 -27
- data/spec/lib/matchers/instance_methods.rb +0 -38
- data/spec/mapping/element_spec.rb +0 -241
- data/spec/mapping/typecasts_spec.rb +0 -52
- data/spec/resource_spec.rb +0 -30
- data/spec/root_spec.rb +0 -26
- data/spec/spec_helper.rb +0 -23
data/spec/root_spec.rb
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
require File.expand_path File.join(File.dirname(__FILE__), 'spec_helper')
|
2
|
-
|
3
|
-
describe SMG::Model, ".root" do
|
4
|
-
|
5
|
-
before :each do
|
6
|
-
@klass = Class.new { include SMG::Resource }
|
7
|
-
end
|
8
|
-
|
9
|
-
it "defines the root tag for further mapping" do
|
10
|
-
@klass.root 'foo'
|
11
|
-
@klass.extract 'a'
|
12
|
-
@klass.mapping.elements.should have_key ['foo','a']
|
13
|
-
end
|
14
|
-
|
15
|
-
it "could be redefined on-the-fly" do
|
16
|
-
@klass.root 'foo'
|
17
|
-
@klass.extract 'a'
|
18
|
-
@klass.root 'bar'
|
19
|
-
@klass.extract 'b'
|
20
|
-
@klass.mapping.elements.should have_key ['foo','a']
|
21
|
-
@klass.mapping.elements.should have_key ['bar','b']
|
22
|
-
end
|
23
|
-
|
24
|
-
end
|
25
|
-
|
26
|
-
# EOF
|
data/spec/spec_helper.rb
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
require 'pathname'
|
2
|
-
require 'rubygems'
|
3
|
-
|
4
|
-
begin
|
5
|
-
|
6
|
-
gem 'rspec', '>=1.2'
|
7
|
-
require 'spec'
|
8
|
-
|
9
|
-
SPEC_ROOT = Pathname(__FILE__).dirname.expand_path
|
10
|
-
|
11
|
-
require SPEC_ROOT + 'lib/matchers/instance_methods'
|
12
|
-
require SPEC_ROOT + 'lib/helpers/http_helpers'
|
13
|
-
|
14
|
-
FIXTURES_DIR = SPEC_ROOT + 'fixtures'
|
15
|
-
|
16
|
-
dir = SPEC_ROOT.parent.join('lib').to_s
|
17
|
-
$:.unshift(dir) unless $:.include?(dir)
|
18
|
-
require 'smg'
|
19
|
-
|
20
|
-
rescue LoadError
|
21
|
-
end
|
22
|
-
|
23
|
-
# EOF
|