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
public class AuthenticationFactory { | |
public static Object result; # Change Object with appropriete type returned from AuthenticationManager | |
public static void init() { | |
# code for authentication and so on | |
self.result = AuthenticationManager.method() | |
} | |
public static Object getResult() { | |
return self.result; |
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
expect(agenda.notes.size).to eq(2) | |
expect(agenda.notes.first.file_name).to eq('todo_list') | |
expect(agenda.notes.first.header).to eq('one') | |
expect(agenda.notes.first.date.class).to eq(LazyMode::Date) | |
expect(agenda.notes.first.date.year).to eq(2012) | |
expect(agenda.notes.first.date.month).to eq(8) | |
expect(agenda.notes.first.date.day).to eq(7) | |
expect(agenda.notes.first.status).to eq(:postponed) | |
expect(agenda.notes.first.body).to eq('one body lies here...') |
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
zaebin(mario):- prezkurin(mario). |
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
import unittest | |
import collections | |
from solution import (RANKS, SUITS, Card, CardCollection, | |
StandardDeck, SixtySixDeck, BeloteDeck) | |
class RankTest(unittest.TestCase): | |
def setUp(self): | |
self.rank_string = 'Three' | |
self.rank = RANKS[self.rank_string]() |
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
class ArrayMatcher | |
attr_reader :matcher | |
def initialize(*matcher) | |
@matcher = matcher | |
end | |
def ===(other) | |
matcher.zip(other).all? {|pair| pair.first === pair.last} | |
end |