Skip to content

Commit

Permalink
(maint) Stop mocking version_is_less in do_install tests
Browse files Browse the repository at this point in the history
Each change to do_install and supporting methods involving a
version_is_less call was requiring additional mocking simulating
version_is_less's behavior.  This is unnecessary given that hosts are
being set with a version, and actually masks behavior of the class.
Removing these specifically because it was causing churn when
introducing meep functionality.
  • Loading branch information
jpartlow committed May 26, 2016
1 parent 3071c5e commit d3e09cc
Showing 1 changed file with 0 additions and 32 deletions.
32 changes: 0 additions & 32 deletions spec/beaker-pe/install/pe_utils_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -400,12 +400,6 @@ def logger
allow( subject ).to receive( :stop_agent_on ).and_return( true )
allow( subject ).to receive( :sleep_until_puppetdb_started ).and_return( true )
allow( subject ).to receive( :max_version ).with(anything, '3.8').and_return('3.0')
allow( subject ).to receive( :version_is_less ).with('3.0', '4.0').and_return( true )
allow( subject ).to receive( :version_is_less ).with('3.0', '3.4').and_return( true )
allow( subject ).to receive( :version_is_less ).with('3.0', '3.0').and_return( false )
allow( subject ).to receive( :version_is_less ).with('3.0', '3.99').and_return( true )
allow( subject ).to receive( :version_is_less ).with('3.99', '3.0').and_return( false )
allow( subject ).to receive( :version_is_less ).with('3.0', '2016.1.0').and_return( true )
allow( subject ).to receive( :wait_for_host_in_dashboard ).and_return( true )
allow( subject ).to receive( :puppet_agent ) do |arg|
"puppet agent #{arg}"
Expand Down Expand Up @@ -476,9 +470,6 @@ def logger
allow( subject ).to receive( :create_remote_file ).and_return( true )
allow( subject ).to receive( :stop_agent_on ).and_return( true )
allow( subject ).to receive( :max_version ).with(['3.0'], '3.8').and_return('3.0')
allow( subject ).to receive( :version_is_less ).with('3.99', '3.0').and_return( false )
allow( subject ).to receive( :version_is_less ).with(anything, '3.2.0').exactly(hosts.length + 1).times.and_return( false )
allow( subject ).to receive( :version_is_less ).with(anything, '4.0').exactly(hosts.length + 1).times.and_return( true )

expect( subject ).to receive( :on ).with( hosts[0], /puppet-enterprise-installer/ ).once
expect( subject ).to receive( :create_remote_file ).with( hosts[0], /answers/, /q/ ).once
Expand Down Expand Up @@ -514,13 +505,6 @@ def logger
allow( subject ).to receive( :stop_agent_on ).and_return( true )
allow( subject ).to receive( :sleep_until_puppetdb_started ).and_return( true )
allow( subject ).to receive( :max_version ).with(anything, '3.8').and_return('4.0')
allow( subject ).to receive( :version_is_less ).with('4.0', '4.0').and_return( false )
allow( subject ).to receive( :version_is_less ).with('4.0', '3.4').and_return( false )
allow( subject ).to receive( :version_is_less ).with('4.0', '3.0').and_return( false )
allow( subject ).to receive( :version_is_less ).with('3.99', '4.0').and_return( true )
allow( subject ).to receive( :version_is_less ).with('4.0', '2016.1.0').and_return( true )
# pe_ver is only set on the hosts for this test, not the opt
allow( subject ).to receive( :version_is_less ).with('4.0', '3.99').and_return( true )
allow( subject ).to receive( :wait_for_host_in_dashboard ).and_return( true )
allow( subject ).to receive( :puppet_agent ) do |arg|
"puppet agent #{arg}"
Expand Down Expand Up @@ -578,14 +562,6 @@ def logger
allow( subject ).to receive( :stop_agent_on ).and_return( true )
allow( subject ).to receive( :sleep_until_puppetdb_started ).and_return( true )
allow( subject ).to receive( :max_version ).with(anything, '3.8').and_return('4.0')
allow( subject ).to receive( :version_is_less ).with('4.0', '4.0').and_return( false )
allow( subject ).to receive( :version_is_less ).with('4.0', '3.4').and_return( false )
allow( subject ).to receive( :version_is_less ).with('4.0', '3.0').and_return( false )
allow( subject ).to receive( :version_is_less ).with('3.99', '4.0').and_return( true )
allow( subject ).to receive( :version_is_less ).with('3.8', '4.0').and_return( true )
allow( subject ).to receive( :version_is_less ).with('4.0', '2016.1.0').and_return( true )
# pe_ver is only set on the hosts for this test, not the opt
allow( subject ).to receive( :version_is_less ).with('4.0', '3.99').and_return( true )
allow( subject ).to receive( :wait_for_host_in_dashboard ).and_return( true )
allow( subject ).to receive( :puppet_agent ) do |arg|
"puppet agent #{arg}"
Expand Down Expand Up @@ -640,14 +616,6 @@ def logger
allow( subject ).to receive( :stop_agent_on ).and_return( true )
allow( subject ).to receive( :sleep_until_puppetdb_started ).and_return( true )
allow( subject ).to receive( :max_version ).with(anything, '3.8').and_return('4.0')
allow( subject ).to receive( :version_is_less ).with('4.0', '4.0').and_return( false )
allow( subject ).to receive( :version_is_less ).with('4.0', '3.4').and_return( false )
allow( subject ).to receive( :version_is_less ).with('4.0', '3.0').and_return( false )
allow( subject ).to receive( :version_is_less ).with('3.99', '4.0').and_return( true )
allow( subject ).to receive( :version_is_less ).with('3.8', '4.0').and_return( true )
allow( subject ).to receive( :version_is_less ).with('4.0', '2016.1.0').and_return( true )
# pe_ver is only set on the hosts for this test, not the opt
allow( subject ).to receive( :version_is_less ).with('4.0', '3.99').and_return( true )
allow( subject ).to receive( :wait_for_host_in_dashboard ).and_return( true )
allow( subject ).to receive( :puppet_agent ) do |arg|
"puppet agent #{arg}"
Expand Down

0 comments on commit d3e09cc

Please sign in to comment.