<commit_before>package br.com.caelum.brutal.model;

import static br.com.caelum.brutal.model.UpdateStatus.PENDING;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import org.junit.Before;
import org.junit.Test;

import br.com.caelum.brutal.builder.QuestionBuilder;

public class QuestionInformationTest {

	private QuestionInformationBuilder builder;
	private Question ruby;

	@Before
	public void setup(){
		builder = new QuestionInformationBuilder();
		ruby = new QuestionBuilder().withTitle("how do i program using ruby?").build();
	}
	
	@Test
	public void should_verify_if_is_before_current_information() {
		
		QuestionInformation version = builder.build();
		ruby.enqueueChange(version, PENDING);
		QuestionInformation infoByModerator = builder.build();
		ruby.approve(infoByModerator);
		
		assertTrue(version.isBeforeCurrent());
	}
	
	@Test
	public void should_verify_if_is_not_before_current_information() {
		
		QuestionInformation infoByModerator = builder.build();
		ruby.approve(infoByModerator);
		QuestionInformation version = builder.build();
		ruby.enqueueChange(version, PENDING);
		
		assertFalse(version.isBeforeCurrent());
	}

}<commit_msg>thread.sleep na tentativa desesperada de corrigir o teste<commit_after>package br.com.caelum.brutal.model;

import static br.com.caelum.brutal.model.UpdateStatus.PENDING;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import org.junit.Before;
import org.junit.Test;

import br.com.caelum.brutal.builder.QuestionBuilder;

public class QuestionInformationTest {

	private QuestionInformationBuilder builder;
	private Question ruby;

	@Before
	public void setup(){
		builder = new QuestionInformationBuilder();
		ruby = new QuestionBuilder().withTitle("how do i program using ruby?").build();
	}
	
	@Test
	public void should_verify_if_is_before_current_information() throws InterruptedException {
		QuestionInformation version = builder.build();
		Thread.sleep(100);
		ruby.enqueueChange(version, PENDING);
		QuestionInformation infoByModerator = builder.build();
		ruby.approve(infoByModerator);
		
		assertTrue(version.isBeforeCurrent());
	}
	
	@Test
	public void should_verify_if_is_not_before_current_information() throws InterruptedException {
		QuestionInformation infoByModerator = builder.build();
		ruby.approve(infoByModerator);
		Thread.sleep(100);
		QuestionInformation version = builder.build();
		ruby.enqueueChange(version, PENDING);
		
		assertFalse(version.isBeforeCurrent());
	}

}
{'fraction_non_alphanumeric': 0.09889676910953507, 'fraction_numerical': 0.002364066193853428, 'mean_word_length': 5.918256130790191, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2405590', 'n_tokens_mistral': 819, 'n_tokens_neox': 749, 'n_words': 151}