Skip to content

Commit

Permalink
fake AutoinstConfigClass class
Browse files Browse the repository at this point in the history
  • Loading branch information
schubi2 committed Aug 14, 2015
1 parent 826e57f commit b230696
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions test/cio_ignore_test.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
#! /usr/bin/env rspec

# fake AutoinstConfigClass class which is not supported by Ubuntu
module Yast
# Faked AutoinstConfigClass module
class AutoinstConfigClass
# we need at least one non-default methods, otherwise ruby-bindings thinks
# it is just namespace
def fake_method
end
end
AutoinstConfig = AutoinstConfigClass.new
end

require_relative "./test_helper"

require "installation/cio_ignore"

describe ::Installation::CIOIgnore do
describe "enable/disable" do

before(:each) do
Yast.import "Mode"
Yast.import "AutoinstConfig"
end

it "take AutoYaST cio_ignore setting if it is enabled" do
allow(Yast::Mode).to receive(:autoinst).and_return(true)
allow(Yast::AutoinstConfig).to receive(:cio_ignore).and_return(false)
Expand Down

0 comments on commit b230696

Please sign in to comment.