Sha256: 77d2cd4c6634f3380a54511c8e01c9af1af75da56ec912fd5e68f25de6c6761b
Contents?: true
Size: 1.5 KB
Versions: 2
Compression:
Stored size: 1.5 KB
Contents
require "pathname" ROOT = Pathname.new(File.expand_path("../../", __FILE__)) $:.unshift((ROOT + "lib").to_s) $:.unshift((ROOT + "spec").to_s) require "bundler/setup" require "pry" require "rspec" require "danger" if `git remote -v` == '' puts "You cannot run tests without setting a local git remote on this repo" puts "It's a weird side-effect of Danger's internals." exit(0) end # Use coloured output, it's the best. RSpec.configure do |config| config.filter_gems_from_backtrace "bundler" config.color = true config.tty = true end require "danger_plugin" # These functions are a subset of https://github.com/danger/danger/blob/master/spec/spec_helper.rb # If you are expanding these files, see if it's already been done ^. # A silent version of the user interface, # it comes with an extra function `.string` which will # strip all ANSI colours from the string. # rubocop:disable Lint/NestedMethodDefinition def testing_ui @output = StringIO.new def @output.winsize [20, 9999] end cork = Cork::Board.new(out: @output) def cork.string out.string.gsub(/\e\[([;\d]+)?m/, "") end cork end # rubocop:enable Lint/NestedMethodDefinition # Example environment (ENV) def testing_env { "HAS_JOSH_K_SEAL_OF_APPROVAL" => "true", "DANGER_LOCAL_ONLY" => "true", "FL_JIRA_SITE" => "https://redmadrobot.atlassian.net" } end # A stubbed out Dangerfile for use in tests def testing_dangerfile env = Danger::EnvironmentManager.new(testing_env) Danger::Dangerfile.new(env, testing_ui) end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
danger-jira_issue_links-0.1.1 | spec/spec_helper.rb |
danger-jira_issue_links-0.1.0 | spec/spec_helper.rb |