rspreedly 0.1.9 → 0.1.10

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.9
1
+ 0.1.10
@@ -49,7 +49,7 @@ module RSpreedly
49
49
 
50
50
  def attributes=(attrs)
51
51
  attrs.each do |k, v|
52
- self.send("#{k}=", v)
52
+ self.send(:"#{k}=", v) if self.respond_to?(:"#{k}=")
53
53
  end
54
54
  end
55
55
 
data/rspreedly.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rspreedly}
8
- s.version = "0.1.9"
8
+ s.version = "0.1.10"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Richard Livsey"]
data/spec/base_spec.rb CHANGED
@@ -1,6 +1,8 @@
1
1
  require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
2
 
3
- class TestAPI < RSpreedly::Base; end
3
+ class TestAPI < RSpreedly::Base
4
+ attr_accessor :something
5
+ end
4
6
 
5
7
  describe RSpreedly::Base do
6
8
 
@@ -13,6 +15,23 @@ describe RSpreedly::Base do
13
15
  end
14
16
  end
15
17
 
18
+ describe "attributes=" do
19
+ before(:each) do
20
+ @api = TestAPI.new
21
+ end
22
+
23
+ it "should assign attributes if they exist" do
24
+ @api.attributes = {:something => "test"}
25
+ @api.something.should == "test"
26
+ end
27
+
28
+ it "should not fail if an attribute does not exist" do
29
+ lambda{
30
+ @api.attributes = {:foo => true}
31
+ }.should_not raise_error
32
+ end
33
+ end
34
+
16
35
  describe "error messages" do
17
36
 
18
37
  before(:each) do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspreedly
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Livsey