Skip to content

Commit

Permalink
Updated Resource::State#resource to be public
Browse files Browse the repository at this point in the history
  • Loading branch information
dkubb committed Apr 8, 2010
1 parent 7552a8b commit 2facec5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 1 addition & 2 deletions lib/dm-core/resource/state.rb
Expand Up @@ -3,6 +3,7 @@ module Resource

# the state of the resource (abstract)
class State
attr_reader :resource

def initialize(resource)
@resource = resource
Expand Down Expand Up @@ -45,8 +46,6 @@ def hash

private

attr_reader :resource

def model
@model ||= resource.model
end
Expand Down
8 changes: 8 additions & 0 deletions spec/semipublic/resource/state_spec.rb
Expand Up @@ -178,6 +178,14 @@ class ::Author
end
end

describe '#resource' do
subject { @state.resource }

it 'should return the resource' do
should equal(@resource)
end
end

describe '#set' do
subject { @state.set(@key, @value) }

Expand Down

0 comments on commit 2facec5

Please sign in to comment.