Skip to content

Commit

Permalink
Merge pull request #196 from mkanoor/add_current_to_mock
Browse files Browse the repository at this point in the history
Added mock support for current
  • Loading branch information
gmcculloug authored Jul 9, 2018
2 parents 378ca08 + 5f40298 commit bbcf066
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
13 changes: 13 additions & 0 deletions spec/miq_ae_mock_service_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
describe "MiqAeMockService" do
let(:root_object) do
Spec::Support::MiqAeMockObject.new('a' => 1, 'b' => 2)
end
let(:ae_service) { Spec::Support::MiqAeMockService.new(root_object) }
let(:current_object) { Spec::Support::MiqAeMockObject.new('x' => 11, 'y' => 21) }

it "#current" do
ae_service.current_object = current_object

expect(ae_service.current['x']).to eq(11)
end
end
8 changes: 8 additions & 0 deletions spec/support/miq_ae_mock_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ def initialize(root, persist_state_hash = {})
@inputs = {}
end

def current_object=(obj)
@current_object = obj
end

def current
@current_object
end

def object=(obj)
@object = obj
end
Expand Down

0 comments on commit bbcf066

Please sign in to comment.