Skip to content

Commit

Permalink
Better file name and documentation for SCRStub
Browse files Browse the repository at this point in the history
  • Loading branch information
ancorgs committed Jan 20, 2015
1 parent a3107f0 commit df49bb7
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
@@ -1,6 +1,33 @@
require "rspec"

# Helpers for stubbing several agent operations.
#
# Requiring the 'scr_stub' file will automatically register SCRStub as a
# RSpec extension.
#
# @example usage
#
# require 'scr_stub'
#
# describe YaST::SCR do
# before do
# chroot = File.join(File.dirname(__FILE__), "test_chroot")
# change_scr_root(chroot)
# end
#
# after do
# reset_scr_root
# end
#
# describe "#Read" do
# it "works with the .proc.meminfo path"
# # This uses the #path helper from SCRStub and
# # reads from ./test_chroot/proc/meminfo
# values = Yast::SCR.Read(path(".proc.meminfo"))
# expect(values).to include("key" => "value")
# end
# end
# end
module SCRStub
# Shortcut for generating Yast::Path objects
#
Expand Down
2 changes: 1 addition & 1 deletion library/general/test/test_helper.rb
Expand Up @@ -3,4 +3,4 @@
ENV["Y2DIR"] = inc_dirs.join(":")

require "yast"
require_relative "SCRStub"
require_relative "scr_stub"
2 changes: 1 addition & 1 deletion library/system/test/test_helper.rb
Expand Up @@ -3,4 +3,4 @@
ENV["Y2DIR"] = inc_dirs.join(":")

require "yast"
require_relative "../../general/test/SCRStub"
require_relative "../../general/test/scr_stub"

0 comments on commit df49bb7

Please sign in to comment.