spec/lib/brief/model_spec.rb in brief-1.0.0 vs spec/lib/brief/model_spec.rb in brief-1.1.0
- old
+ new
@@ -29,10 +29,15 @@
it "has the attributes defined in the DSL" do
set = Brief::Model::UserStory.attribute_set.map(&:name)
expect(set).to include(:title, :status, :epic_title)
end
+
+ it "has attribute setters" do
+ story = Brief::Model::UserStory.new
+ expect(story).to respond_to(:title=)
+ end
end
context "Class Definitions" do
it "picks up a defintion of 'Epic'" do
expect((Brief::Epic rescue nil)).to be_present
@@ -53,10 +58,16 @@
it "has the attributes defined inline in the class methods" do
set = Brief::Epic.attribute_set.map(&:name)
expect(set).to include(:path, :document, :title, :status)
end
+
+ it "has attribute setters" do
+ epic = Brief::Epic.new
+ expect(epic).to respond_to(:title=)
+ expect(epic).to respond_to(:subheading=)
+ end
end
context "Briefcase Finders" do
it "creates methods on the briefcase for each class" do
expect(briefcase.epics).not_to be_empty
@@ -77,8 +88,18 @@
expect(epic.extracted).to be_a(Brief::Document::ContentExtractor)
end
it "uses the configured content extractor settings" do
expect(epic.extracted.title).to eq("Blueprint Epic Example")
+ end
+ end
+
+ context "Actions and Helpers" do
+ it "uses the actions block to define CLI dispatchers" do
+ expect(epic.class.defined_actions).to include(:custom_action)
+ end
+
+ it "users the actions block to define CLI dispatchers (dsl)" do
+ expect(user_story.class.defined_actions).to include(:custom_action)
end
end
end