Permalink
Browse files

Removed unused code

  • Loading branch information...
1 parent 088dba1 commit 362fa63d5ec2522bae2e2b2b955a6a973aa56338 @jcoyne jcoyne committed May 12, 2012
Showing with 2 additions and 85 deletions.
  1. +1 −1 Gemfile.lock
  2. +0 −30 lib/active_fedora/model.rb
  3. +1 −1 lib/active_fedora/version.rb
  4. +0 −53 spec/unit/model_spec.rb
View
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
- active-fedora (4.1.0)
+ active-fedora (4.2.0)
activeresource (>= 3.0.0)
activesupport (>= 3.0.0)
equivalent-xml
View
@@ -349,18 +349,6 @@ def class_fields
return fields
end
- #TODO remove
- #wrapper around instance_variable_set, sets @name to value
- def attribute_set(name, value)
- instance_variable_set("@#{name}", value)
- end
-
- #TODO remove
- #wrapper around instance_variable_get, returns current value of @name
- def attribute_get(name)
- instance_variable_get("@#{name}")
- end
-
private
# Retrieve the Fedora object with the given pid, explore the returned object, determine its model
# using #{ActiveFedora::ContentModel.known_models_for} and cast to that class.
@@ -378,24 +366,6 @@ def find_one(pid, cast=false)
end
end
- #TODO remove
- def create_property_getter(property) # :nodoc:
-
- class_eval <<-END, __FILE__, __LINE__
- def #{property.name}
- attribute_get("#{property.name}")
- end
- END
- end
-
- #TODO remove
- def create_property_setter(property)# :nodoc:
- class_eval <<-END, __FILE__, __LINE__
- def #{property.name}=(value)
- attribute_set("#{property.name}", value)
- end
- END
- end
private
@@ -1,3 +1,3 @@
module ActiveFedora
- VERSION = "4.1.0"
+ VERSION = "4.2.0"
end
View
@@ -10,65 +10,12 @@ def initialize (args = {})
end
end
end
- @test_property = ActiveFedora::Property.new("foo_model","test_property", :text)
- end
-
- before(:each) do
- ActiveFedora::Base.stubs(:assign_pid).returns('_nextid_')
- @test_instance = SpecModel::Basic.new
- @property = stub("myproperty", :name => "mock_prop", :instance_variable_name => "@mock_prop")
- SpecModel::Basic.extend(ActiveFedora::Model)
- SpecModel::Basic.create_property_getter(@property)
- @obj = SpecModel::Basic.new
end
after(:all) do
Object.send(:remove_const, :SpecModel)
end
- it 'should provide #attribute_set and #attribute_get' do
- SpecModel::Basic.should respond_to(:attribute_set)
- SpecModel::Basic.should respond_to(:attribute_get)
- end
-
- it 'should provide #create_property_getter' do
- SpecModel::Basic.should respond_to(:create_property_getter)
- end
-
- describe '#create_property_getter' do
- it 'should add getter to the model' do
- @obj.should respond_to(@property.name)
- end
-
- it 'should use attribute_get in custom getter method' do
- @obj.expects(:attribute_get).with(@property.name)
- @obj.send @property.name
- end
-
- end
-
- it 'should provide #create_property_setter' do
- SpecModel::Basic.should respond_to(:create_property_setter)
- end
-
- describe '#create_property_setter' do
-
- before(:each) do
- @property = stub("myproperty", :name => "mock_prop", :instance_variable_name => "@mock_prop")
- SpecModel::Basic.create_property_setter(@property)
- @obj = SpecModel::Basic.new
- end
-
- it 'should add setter to the model' do
- @obj.should respond_to("#{@property.name}=")
- end
-
- it 'should use attribute_set in custom setter method' do
- @obj.expects(:attribute_set).with(@property.name, "sample value")
- @obj.send "#{@property.name}=", "sample value"
- end
-
- end
describe '#find' do
describe "without :cast" do

0 comments on commit 362fa63

Please sign in to comment.