forked from billforward/bf-ruby
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
73 lines (57 loc) · 2.44 KB
/
Rakefile
File metadata and controls
73 lines (57 loc) · 2.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
require "bundler/gem_tasks"
begin
require 'rspec/core/rake_task'
# these specs test syntax and language features
syntax_specs = FileList['spec/syntax/*_spec.rb']
# these specs use mocking to test entities without calling a real API
component_specs = FileList['spec/component/*_spec.rb']
# these specs call the API, but in a read-only manner
functional_good_citizen_specs = FileList['spec/functional/*_spec.rb']
# these specs call the API, leaving lasting side-effects
functional_bad_citizen_specs = FileList['spec/functional/bad_citizen/*_spec.rb']
# these specs call the API, and also require prior setup (for example, ensure an invoice exists beforehand)
# we do not consider these part of the main run, as they're particularly bad citizens
functional_situational_specs = FileList['spec/functional/bad_citizen/situational/*_spec.rb']
# offline tests
fast_specs = FileList[]
fast_specs.concat(syntax_specs)
fast_specs.concat(component_specs)
# offline tests + main functional run
main_specs = FileList[]
main_specs.concat(fast_specs)
puts functional_good_citizen_specs
main_specs.concat(functional_good_citizen_specs)
main_specs.concat(functional_bad_citizen_specs)
# offline tests + main functional run + situational functional
all_specs = FileList[]
all_specs.concat(main_specs)
all_specs.concat(functional_situational_specs)
RSpec::Core::RakeTask.new(:spec_offline) do |t|
spec_files = FileList[]
spec_files.concat(fast_specs)
# trick t.pattern into accepting a list of files (otherwise deprecated)
# otherwise globbing does not work on Windows (only first file is matched)
t.pattern = spec_files
t.rspec_opts = "--color --format documentation"
end
RSpec::Core::RakeTask.new(:spec_main) do |t|
spec_files = FileList[]
spec_files.concat(main_specs)
# trick t.pattern into accepting a list of files (otherwise deprecated)
# otherwise globbing does not work on Windows (only first file is matched)
t.pattern = spec_files
t.rspec_opts = "--color --format documentation"
end
RSpec::Core::RakeTask.new(:spec_all) do |t|
spec_files = FileList[]
spec_files.concat(all_specs)
# trick t.pattern into accepting a list of files (otherwise deprecated)
# otherwise globbing does not work on Windows (only first file is matched)
t.pattern = spec_files
t.rspec_opts = "--color --format documentation"
end
# Make 'Rspec test run' the default task
task :default => :spec_offline
rescue LoadError
# no rspec available
end