类: RSpec::Core::RakeTask
- 继承
-
Rake::TaskLib
- Object
- Rake::TaskLib
- RSpec::Core::RakeTask
- 包含
- Rake::DSL
- 定义于
- lib/rspec/core/rake_task.rb
概述
RSpec rake 任务
常量摘要 折叠
- DEFAULT_RSPEC_PATH =
RSpec 可执行文件的默认路径。
File.('../../../../exe/rspec', __FILE__)
- DEFAULT_PATTERN =
规范文件的默认模式。
'spec/**{,/*/**}/*_spec.rb'
实例属性摘要 折叠
-
#exclude_pattern ⇒ void
匹配此模式的文件将被排除。
-
#fail_on_error ⇒ void
当发生错误时(通常是示例失败时)是否使 Rake 失败。
-
#failure_message ⇒ void
在出现失败时打印到 stderr 的消息。
-
#name ⇒ void
任务的名称。
-
#pattern ⇒ void
匹配此模式的文件将被加载。
-
#rspec_opts ⇒ void
传递给 RSpec 的命令行选项。
-
#rspec_path ⇒ void
RSpec 的路径。
-
#ruby_opts ⇒ void
传递给 ruby 的命令行选项。
-
#verbose ⇒ void
使用详细输出。
-
#with_clean_environment ⇒ void
在干净(空的)环境中运行 RSpec。
实例方法摘要 折叠
-
#initialize(*args, &task_block) ⇒ RakeTask 构造函数
RakeTask 的新实例。
构造函数详情
#initialize(*args, &task_block) ⇒RakeTask
返回 RakeTask 的新实例。
79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/rspec/core/rake_task.rb', line 79 def initialize(*args, &task_block) @name = args.shift || :spec @ruby_opts = nil @rspec_opts = nil @verbose = true @fail_on_error = true @rspec_path = DEFAULT_RSPEC_PATH @pattern = DEFAULT_PATTERN define(args, &task_block) end |
实例属性详情
#exclude_pattern ⇒void
匹配此模式的文件将被排除。默认值为 nil
。
39 40 41 |
# File 'lib/rspec/core/rake_task.rb', line 39 def exclude_pattern @exclude_pattern end |
#fail_on_error ⇒void
当发生错误时(通常是示例失败时)是否使 Rake 失败。默认值为 true
。
43 44 45 |
# File 'lib/rspec/core/rake_task.rb', line 43 def fail_on_error @fail_on_error end |
#failure_message ⇒void
在出现失败时打印到 stderr 的消息。
46 47 48 |
# File 'lib/rspec/core/rake_task.rb', line 46 def @failure_message end |
#name ⇒void
任务的名称。默认值为 :spec
。
31 32 33 |
# File 'lib/rspec/core/rake_task.rb', line 31 def name @name end |
#pattern ⇒void
匹配此模式的文件将被加载。默认值为 'spec/**{,/*/**}/*_spec.rb'
。
35 36 37 |
# File 'lib/rspec/core/rake_task.rb', line 35 def pattern @pattern end |
#rspec_opts ⇒void
传递给 RSpec 的命令行选项。默认值为 nil
。
77 78 79 |
# File 'lib/rspec/core/rake_task.rb', line 77 def rspec_opts @rspec_opts end |
#rspec_path ⇒void
RSpec 的路径。默认值为从已加载的 rspec-core gem 中获取的 rspec 二进制文件的绝对路径。
74 75 76 |
# File 'lib/rspec/core/rake_task.rb', line 74 def rspec_path @rspec_path end |
#ruby_opts ⇒void
传递给 ruby 的命令行选项。默认值为 nil
。
70 71 72 |
# File 'lib/rspec/core/rake_task.rb', line 70 def ruby_opts @ruby_opts end |
#verbose ⇒void
使用详细输出。如果将其设置为 true,则任务将把执行的规范命令打印到 stdout。默认值为 true
。
67 68 69 |
# File 'lib/rspec/core/rake_task.rb', line 67 def verbose @verbose end |
#with_clean_environment ⇒void
在干净(空的)环境中运行 RSpec。
56 57 58 |
# File 'lib/rspec/core/rake_task.rb', line 56 def with_clean_environment false end |