spec/neovim/api_spec.rb in neovim-0.2.4 vs spec/neovim/api_spec.rb in neovim-0.2.5
- old
+ new
@@ -4,12 +4,12 @@
RSpec.describe API do
describe ".null" do
it "returns an empty API object" do
api = API.null
- expect(api.types).to eq([])
- expect(api.functions).to eq([])
+ expect(api.types).to be_empty
+ expect(api.functions).to be_empty
end
end
describe "#function" do
it "returns a corresponding Function object" do
@@ -27,13 +27,17 @@
end
describe "#functions_with_prefix" do
it "returns relevant functions" do
api = API.new(
- [nil, {"functions" => [{"name" => "vim_strwidth"}]}]
+ [nil, {"functions" => [
+ {"name" => "vim_strwidth"},
+ {"name" => "buffer_get_lines"}
+ ]}]
)
functions = api.functions_with_prefix("vim_")
+ expect(functions.size).to be(1)
expect(functions.first.name).to eq("vim_strwidth")
end
end
end
end