-
Notifications
You must be signed in to change notification settings - Fork 0
/
project_spec.rb
39 lines (31 loc) · 1.19 KB
/
project_spec.rb
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
require "spec_helper"
describe Belugas::Project do
before {
@rugged = double("rugged")
@linguist_project = double("linguist_project")
allow(@rugged).to receive(:path).and_return("adir/anotherdir/name_project")
allow(@linguist_project).to receive(:size).and_return(10)
allow(@linguist_project).to receive(:breakdown_by_file).and_return({"Ruby": ["/lib/belugas.rb"]})
allow(@linguist_project).to receive(:language).and_return("Ruby")
allow(@linguist_project).to receive(:languages).and_return(["Ruby"])
}
subject { Belugas::Project.new(@rugged, @linguist_project) }
it "responds to name" do
expect(subject.name).to eq("name_project")
end
it "responds to size" do
expect(subject.size).to be_kind_of(Integer)
end
it "responds to total_files" do
expect(subject.total_files).to be_kind_of(Integer)
end
it "responds to top_language" do
expect(subject.top_language).to eq("Ruby")
end
it "responds to collection" do
expect(subject.collection).to be_kind_of(Belugas::Languages::Collection)
end
it "responds to json" do
expect(subject.to_json).to eq({"name":"name_project","size":10,"total_files":1,"top_language":"Ruby"}.to_json)
end
end