currently, we don't have a matcher for ensuring 2 iterables have same
elements, ignoring the order.
We have include_in_any_order and include_all_of, but they check if
actual have all elements that expected has, but actual itself may have
other different elements.
Maybe include_in_any_order can be changed to match this need.
Regardless the name, I think we need this kind of matcher. For
example,currently we have to do:
configurable |should| have(2).states
configurable.states |should| include_all_of(['start', 'created'])
With that matcher we could write:
configurable.states |should| have_same_elements_to(['start', 'created'])
Ok to add this matcher to Should-DSL?
[]'s
-------
Rodrigo S. Manhães
-------
Núcleo de Pesquisa em Sistemas de Informação/IFF
Laboratório de Ciências Matemáticas/UENF
-------
Github: https://github.com/rodrigomanhaes
Lattes: http://lattes.cnpq.br/9851240805895558
Bye
2011/4/18 Rodrigo Manhães <rman...@gmail.com>:
--
Rogerio Atem de Carvalho
No, since configurable can be ['created', 'start'] and python lists are ordered.
[]'s
Rodrigo
What about duplicated elements? For instance:
mylist = [1, 2, 1]
I need some minutes to think about this new matcher.
Talk to you later!
[1, 2, 1] should not equal [1, 2] ignoring order
[1, 2, 1] should equal [2, 1, 1] ignoring order
[]'s
Rodrigo
2011/4/24 Hugo Lopes Tavares <hlt...@gmail.com>:
Isn't it `have_same_elements_as`?
Regards
2011/4/27 Hugo Lopes Tavares <hlt...@gmail.com>:
--
Rogerio Atem de Carvalho
If I would think about another possibility it would be using named
parameters. Like:
foo |should| equal_to(some_set, ignore_sort=True)
foo |should| equal_to(some_set, sorted=False)
Just spreading some ideas... The problem with these alternatives is we
loose some natural readability.
Later!
bye
2011/4/28 Hugo Lopes Tavares <hlt...@gmail.com>: