ruby-on-rails - 如何通过rake任务传递-f specdoc选项

标签 ruby-on-rails rspec

我正在使用Rails 2.3.5 .rake spec正常工作。

这是来自规范--help。

spec --help

-f, --format FORMAT[:WHERE]      Specifies what format to use for output. Specify WHERE to tell
                                    the formatter where to write the output. All built-in formats
                                    expect WHERE to be a file name, and will write to $stdout if it's
                                    not specified. The --format option may be specified several times
                                    if you want several outputs

                                    Builtin formats:
                                    silent|l                 : No output
                                    progress|p               : Text-based progress bar
                                    profile|o                : Text-based progress bar with profiling of 10 slowest examples
                                    specdoc|s                : Code example doc strings
                                    nested|n                 : Code example doc strings with nested groups indented
                                    html|h                   : A nice HTML report
                                    failing_examples|e       : Write all failing examples - input for --example

                                failing_example_groups|g : Write all failing example groups - input for --example

如何通过rake任务传递-f specdoc。

最佳答案

将.rspec文件添加或编辑到rails根目录。例如,我的现在包含以下选项:

--colour
--format documentation

请注意,specdoc格式的新名称是RSpec 2.1中的文档。

关于ruby-on-rails - 如何通过rake任务传递-f specdoc选项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2890521/

相关文章:

ruby-on-rails - 大礼包安装不工作。收到错误 : undefined method `add_module' for Devise:Module (NoMethodError)

ruby-on-rails - 我如何重组这个大型 PostgreSQL 9.3 表,以便从 Rails 应用程序更有效地建立索引和搜索?

ruby - 我可以模拟 RSpec double 的类名吗?

ruby-on-rails - mongrel 可以用于 ruby​​ on rails 的生产吗?

ruby-on-rails - Rails paths.rb 语法

ruby-on-rails - Rails 优化复杂查询

ruby-on-rails - 我在使用 RSpec 和 Factory-bot-rails 测试 Controller 时得到 'KeyError: Factory not registered: "user"'

ruby - 通过 Guard 运行由行号指定的规范

ruby - RSpec 只能在我的 Lib 目录的根目录中看到类

ruby-on-rails - 为什么我必须在使用客户验证器后重新加载 rspec 中的记录?