Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/postgresql/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
“这个”的旧名字是什么;描述;及;它";rspec中的方法?_Rspec - Fatal编程技术网

“这个”的旧名字是什么;描述;及;它";rspec中的方法?

“这个”的旧名字是什么;描述;及;它";rspec中的方法?,rspec,Rspec,我发现rspec中的方法名description和it有点违反直觉。我读到这两种方法在早期版本的rspec中有不同的名称,但在谷歌搜索了一段时间后,仍然无法发现它们是什么 有人知道it和以前的名称描述了rspec中的方法吗 希望这能让我更好地理解他们的意图 见: …早期版本的RSpec使用上下文和指定,而不是描述和它 查看此处的代码,您可以使用it,示例,或指定。因此,以下是等效的: describe School do it 'has many students' {} speci

我发现rspec中的方法名
description
it
有点违反直觉。我读到这两种方法在早期版本的rspec中有不同的名称,但在谷歌搜索了一段时间后,仍然无法发现它们是什么

有人知道
it
以前的名称描述了rspec中的方法吗

希望这能让我更好地理解他们的意图

见:

…早期版本的RSpec使用
上下文
指定
,而不是
描述

查看此处的代码,您可以使用
it
示例
,或
指定
。因此,以下是等效的:

describe School do

  it 'has many students' {}

  specify 'has many students' {}

  example 'has many students' {}

end
上下文”
”仍然有效,并由may RSpec'ers使用。通常,在外部
描述
块中提供更多详细信息

这:

而不是:

describe School do

  describe '#roster' do
    it '...'
  end

end
describe School do

  describe '#roster' do
    it '...'
  end

end