File: spec_helper.rb

package info (click to toggle)
ruby-jira 2.1.5-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 968 kB
  • sloc: ruby: 5,125; makefile: 12
file content (19 lines) | stat: -rw-r--r-- 556 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'webmock/rspec'
require 'pry'

Dir['./spec/support/**/*.rb'].each { |f| require f }

require 'jira-ruby'

RSpec.configure do |config|
  config.extend ClientsHelper
end

def get_mock_response(file, value_if_file_not_found = false)
  file.sub!('?', '_') # we have to replace this character on Windows machine
  File.read(File.join(File.dirname(__FILE__), 'mock_responses/', file))
rescue Errno::ENOENT => e
  raise e if value_if_file_not_found == false
  value_if_file_not_found
end