Skip to content

Commit 082aa70

Browse files
author
Sunny Raj Rathod
authored
Update sample_code_spec.rb
1 parent 0e50937 commit 082aa70

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

spec/sample_code_spec.rb

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,27 @@
1-
require "spec_helper"
1+
cwd = Dir.pwd
2+
3+
if cwd.include? "sample-code-ruby"
4+
puts "String includes sample-code-ruby"
5+
specpath = "./spec/"
6+
dirpath = "./"
7+
else
8+
specpath = "./sample-code-ruby/spec/"
9+
dirpath = "./sample-code-ruby/"
10+
end
11+
12+
require specpath + "spec_helper"
213

314
include AuthorizeNet::API
415

516
describe "SampleCode Testing" do
617

718
before :all do
819
begin
9-
Dir.glob("./**/*.rb") do |item| # note one extra "*"
20+
Dir.glob(dirpath + "**/*.rb") do |item| # note one extra "*"
1021
next if item == '.' or item == '..'
1122
item = item[0..-4]
1223

13-
if item != './spec/sample_code_spec'
24+
if item != specpath + 'sample_code_spec'
1425
puts "working on: #{item}"
1526
require item
1627
end

0 commit comments

Comments
 (0)