<commit_before>require 'github_scrumboard'
describe GithubScrumboard::UserStory do
  let (:body) {
'''
As somebody
I want...

=Acceptance Criteria:
* at least something should be possible
'''
}

  context ".new(issue)" do
    context "extracts details, that are marked by a sign" do
      before(:each) do
        GithubScrumboard::UserStory.any_instance.stub(:extract).and_return(1)
        GithubScrumboard::Settings.issues.prefix.stub(:details).and_return('=')
      end

      context "from the comment section of an issue" do
          let (:issue) {{'title' => "A Neat Title", 'body' => "As a user\nI want...", 'number' => 1}}
          subject {GithubScrumboard::UserStory.new(issue)}

          it "but only the text that is marked up" do
            pending do
              subject.details.should =~ /Details:.* this is a hint/
            end
          end

          it "multiple detail descriptions are tied together" do
            pending do
              subject.details.should =~ /Details:.* this is a hint.*this is an implementation detail/
            end
          end

      end

      context "from the body of an issue" do
        let (:issue) {{ 'title' => 'A Neat Title', 'body' => body, 'number' => 2}}
        subject {GithubScrumboard::UserStory.new(issue)}

        it "e.g. acceptance criteria" do
          subject.details.should =~ /Acceptance Criteria:.*at least something should be possible/m
        end

        it "that won't go into the main text of a user story" do
          subject.text.should_not =~ /Acceptance Criteria:.*at least something should be possible/m
        end

        it 'and won\'t crash, if there is no details section at all' do
          issue['body'] = "Somthing, that is not a details section"
          story = GithubScrumboard::UserStory.new(issue)
          story.details.should be_empty
          story.text.should eq issue['body']
        end

        context "the ending is" do
          it "an empty line" do
            issue['body'] << "\n \nfoobar"
            story = GithubScrumboard::UserStory.new(issue)
            story.details.should include("Acceptance Criteria:")
            story.details.should include("something")
            story.details.should_not include("foobar")
            story.text.should include("foobar")
          end<commit_msg>more assetions in the rspec<commit_after>require 'github_scrumboard'
describe GithubScrumboard::UserStory do
  let (:body) {
'''
As somebody
I want...

=Acceptance Criteria:
* at least something should be possible
'''
}

  context ".new(issue)" do
    context "extracts details, that are marked by a sign" do
      before(:each) do
        GithubScrumboard::UserStory.any_instance.stub(:extract).and_return(1)
        GithubScrumboard::Settings.issues.prefix.stub(:details).and_return('=')
      end

      context "from the comment section of an issue" do
          let (:issue) {{'title' => "A Neat Title", 'body' => "As a user\nI want...", 'number' => 1}}
          subject {GithubScrumboard::UserStory.new(issue)}

          it "but only the text that is marked up" do
            pending do
              subject.details.should =~ /Details:.* this is a hint/
            end
          end

          it "multiple detail descriptions are tied together" do
            pending do
              subject.details.should =~ /Details:.* this is a hint.*this is an implementation detail/
            end
          end

      end

      context "from the body of an issue" do
        let (:issue) {{ 'title' => 'A Neat Title', 'body' => body, 'number' => 2}}
        subject {GithubScrumboard::UserStory.new(issue)}

        it "e.g. acceptance criteria" do
          subject.text.should =~ /As somebody/
          subject.details.should =~ /Acceptance Criteria:.*at least something should be possible/m
        end

        it "that won't go into the main text of a user story" do
          subject.text.should =~ /As somebody/
          subject.text.should_not =~ /Acceptance Criteria:.*at least something should be possible/m
        end

        it 'and won\'t crash, if there is no details section at all' do
          issue['body']= "Something, that is not a details section\n\nDefinitely not"
          story = GithubScrumboard::UserStory.new(issue)
          story.details.should be_empty
          story.text.should eq issue['body']
        end

        context "the ending is" do
          it "an empty line" do
            issue['body'] << "\n \nfoobar"
            story = GithubScrumboard::UserStory.new(issue)
            story.details.should include("Acceptance Criteria:")
            story.details.should include("something")
            story.details.should_not include("foobar")
            story.text.should include("foobar")
          end
{'fraction_non_alphanumeric': 0.10744147157190635, 'fraction_numerical': 0.001254180602006689, 'mean_word_length': 2.24847250509165, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5736030', 'n_tokens_mistral': 1349, 'n_tokens_neox': 1299, 'n_words': 438}