-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Bue Petersen
committed
May 1, 2017
1 parent
898cedd
commit 189c1ae
Showing
3 changed files
with
55 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
require_relative '../lib/model.rb' | ||
|
||
RSpec.describe Model do | ||
describe "class PACTask" do | ||
|
||
describe ".new" do | ||
context "Task initialized" do | ||
let(:pt) { Model::PACTask.new() } | ||
it "without task id should have task_id nil" do | ||
expect(pt.task_id).to eq(nil) | ||
end | ||
|
||
let(:pt_id) { Model::PACTask.new(3) } | ||
it "with something else than a string should raiseArgument error as we expect it to be a string later" do | ||
expect{Model::PACTask.new(3)}.to raise_error(ArgumentError) | ||
end | ||
end | ||
end | ||
|
||
|
||
|
||
describe "applies_to" do | ||
let(:pt) { Model::PACTask.new() } | ||
|
||
context "Given a new task" do | ||
it "applies_to should be empty" do | ||
expect(pt.applies_to.length).to be 0 | ||
end | ||
|
||
it "applies_to should return the set of applied tasks systems" do | ||
pt.applies_to = 'mytaskssystem' | ||
ts = Set.new ['mytaskssystem'] | ||
expect(pt.applies_to).to eq(ts) # not object identity, just content | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters