Skip to content

Commit

Permalink
Merge aab4206 into 179351c
Browse files Browse the repository at this point in the history
  • Loading branch information
cwh42 committed Apr 1, 2015
2 parents 179351c + aab4206 commit e994b21
Show file tree
Hide file tree
Showing 4 changed files with 147 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ before_install:
# disable rvm, use system Ruby
- rvm reset
- wget https://raw.githubusercontent.com/yast/yast-devtools/master/travis-tools/travis_setup.sh
- sh ./travis_setup.sh -p "yast2-devtools yast2 yast2-packager rake" -g "gettext yast-rake yard rspec:2.14.1 simplecov coveralls rubocop:0.29.1"
- sh ./travis_setup.sh -p "yast2-devtools yast2 yast2-packager yast2-installation rake" -g "gettext yast-rake yard rspec:2.14.1 simplecov coveralls rubocop:0.29.1"
script:
- rake check:syntax
- rake check:pot
Expand Down
2 changes: 2 additions & 0 deletions package/yast2-migration.spec
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ Requires: yast2
Requires: yast2-packager
Requires: yast2-pkg-bindings
Requires: yast2-ruby-bindings
Requires: yast2-installation
Requires: yast2-update

BuildArch: noarch

Expand Down
72 changes: 72 additions & 0 deletions src/lib/migration/proposal_store.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# encoding: utf-8

# ------------------------------------------------------------------------------
# Copyright (c) 2014 Novell, Inc. All Rights Reserved.
#
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of version 2 of the GNU General Public License as published by the
# Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, contact Novell, Inc.
#
# To contact Novell about this file by physical or electronic mail, you may find
# current contact information at www.novell.com.
# ------------------------------------------------------------------------------

require "yast"
require "installation/proposal_store"

module Migration
# Provides access to static metadata for update proposal.
class ProposalStore < Installation::ProposalStore
include Yast::Logger
include Yast::I18n

PROPOSAL_NAMES = ["update_proposal"]
PROPOSAL_PROPERTIES = {}
MODULES_ORDER = PROPOSAL_NAMES

def initialize(_unused_mode)
textdomain "migration"

super("migration")
end

# @return [String] translated headline
def headline
_("Migration proposal")
end

# @return [Array<String>] proposal names in execution order, including
# the "_proposal" suffix
def proposal_names
PROPOSAL_NAMES
end

# returns single list of modules presentation order or list of tabs with
# list of modules
def presentation_order
MODULES_ORDER
end

private

def global_help
_(
"<p>\n" \
"To start online migration, press <b>Next</b>.\n" \
"</p>\n"
)
end

def properties
PROPOSAL_PROPERTIES
end
end
end
72 changes: 72 additions & 0 deletions test/proposal_store_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# ------------------------------------------------------------------------------
# Copyright (c) 2015 SUSE GmbH, All Rights Reserved.
#
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of version 2 of the GNU General Public License as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, contact SUSE GmbH.
#
# To contact SUSE about this file by physical or electronic mail, you may find
# current contact information at www.suse.com.
# ------------------------------------------------------------------------------

require_relative "test_helper"

require "migration/proposal_store"

module Yast

extend Yast::I18n

describe Migration::ProposalStore do
subject { Migration::ProposalStore.new(nil) }

describe ".headline" do
it "returns a headline" do
expect(subject.headline).to eq(Yast::_("Migration proposal"))
end
end

describe ".proposal_names" do
it "returns an update proposal" do
expect(subject.proposal_names).to eq ["update_proposal"]
end
end

describe ".presentation_order" do
it "returns a presentation order" do
expect(subject.presentation_order).to eq ["update_proposal"]
end
end

describe ".help_text" do
it "returns the right help text" do
help_string = Yast::_(
"<p>\n" \
"To start online migration, press <b>Next</b>.\n" \
"</p>\n"
)
expect(subject.help_text.start_with?(help_string)).to eq true
end
end

describe ".icon" do
it "returns 'yast-software'" do
expect(subject.icon).to eq "yast-software"
end
end

describe ".tabs?" do
it "returns false" do
expect(subject.tabs?).to eq false
end
end
end
end

0 comments on commit e994b21

Please sign in to comment.