Sha256: d746d454bbe2843de1c97e0239360432058ee0aee913167e41e7c74ac18fbcee

Contents?: true

Size: 1.02 KB

Versions: 5

Compression:

Stored size: 1.02 KB

Contents

require 'tap/test/assertions'
require 'tap/test/script_tester'
require 'tap/test/subset_test'

module Tap
  module Test
    module ScriptTest
      
      def self.included(base)
        super
        base.send(:include, Tap::Test::SubsetTest)
        base.send(:include, Tap::Test::Assertions) 
      end
      
      def default_command_path
        nil
      end
      
      def script_test(test_dir=method_root.root)
        subset_test("SCRIPT", "s") do
          Tap::Root.chdir(test_dir, true) do  
            Utils.with_argv do
              puts "\n# == #{name}"

              cmd = ScriptTester.new(default_command_path, env_var('stepwise')) do |expected, result, msg|
                case expected
                when String
                  assert_output_equal(expected, result, msg)
                when Regexp
                  assert_alike(expected, result, msg)
                end
              end
              
              yield(cmd)
            end
          end
        end
      end
      
    end
  end
end




Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
tap-0.12.2 lib/tap/test/script_test.rb
tap-0.12.4 lib/tap/test/script_test.rb
tap-0.12.3 lib/tap/test/script_test.rb
tap-0.12.0 lib/tap/test/script_test.rb
tap-0.12.1 lib/tap/test/script_test.rb