similar to: custom matcher tutorial

Displaying 20 results from an estimated 10000 matches similar to: "custom matcher tutorial"

2007 May 04
2
Custom Matcher and NAME NOT GENERATED annoyance
Hello RSpec users, Have been using RSpec since 0.8.2 (not too long ago, I must say). and been creating my custom matchers since was defined as "good practice". Also, auto-generated names for the examples is very helpful, I''m trying to take advantage of it. Since I often prior code/define all the "examples", I have created a few matchers to fulfill associations and
2007 Jun 29
0
[Screencast ANN] Smarticast: ActiveRecord Grab Bag
I just put a new screencast with a few ActiveRecord tips: http://smartic.us/2007/6/29/2-activerecord-grab-bag thanks bryanl --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To
2007 Feb 18
1
get() method in custom expectation matcher?
I''m trying to write a custom expectation: controller.should_require_login_for(:action_name). I''m using the example in the docs for ''Custom Expectation Matchers'' but I''m unsure how to make the get() method available to my ShouldRequireLogin class. I''ve tried requiring spec_helper but no joy. can anyone help? thanks -- View this message in
2008 Apr 29
5
Sharing: dont_repeat_yourself plugin custom RSpec matcher
I wrote a Rails plugin which uses simian to look for duplicates lines in your code and reports in html format, Textmate or Netbeans. I wrote it using RSpec and I have included a RSpec custom matcher: it { rails_application. with_threshold_of_duplicate_lines(4). should be_DRY } If you use Autotest, your specs will fail the next time you do a nasty copy-paste !!! More details in
2011 Jul 28
2
RSpec, shoulda-matchers and Rails model attributes validations
I was trying out RSpec framework in a project and got stopped doing the unit test of a model. In particular, doing the test for the associations and the ActiveRecord validations. I started writing the validations but my tests didn''t look DRY at all. Before refactoring the tests checked out and look for other people solutions. I found out shoulda-matchers and Shoulda (which if I
2007 Oct 25
0
Fwd: [ mocha-Feature Requests-15021 ] without or not params matcher
---------- Forwarded message ---------- From: noreply at rubyforge.org <noreply at rubyforge.org> Date: 25 Oct 2007 14:01 Subject: [ mocha-Feature Requests-15021 ] without or not params matcher To: noreply at rubyforge.org Feature Requests item #15021, was opened at 2007-10-24 15:33 You can respond by visiting:
2012 Feb 03
0
[LLVMdev] HELP - tblgen -gen-asm-matcher restrictions on .td content
Hi Jack, On Jan 25, 2012, at 6:45 PM, "Carter, Jack" <jcarter at mips.com> wrote: > I'm trying to generate MipsGenAsmMatcher.inc for MipsAsmParser.cpp. > > What added restrictions for the .td file contents are there for tblgen -gen-asm-matcher? > Lots, as you're finding, almost all of them completely undocumented. :( > For the Mips platform we create
2016 Jul 26
2
[PATCH] Add support for the 'unless' matcher in the dynamic layer.
I was wondering if there is any objection to removing the 2-element minimum on the eachOf, anyOf and allOf matchers. It is frustrating when playing with matchers to have to edit significant amounts of code to be able to temporarily go from 2 to 1 matcher inside an any- or allOf matcher. And overall it feels very "un-set-theory"-like. The change was made here:
2016 Nov 28
2
Looking for help with an ast matcher
Hi Piotr, I think I found a working matcher: match ifStmt(hasCondition(implicitCastExpr(hasImplicitDestinationType(isInteger()), has(cxxMemberCallExpr(callee(cxxMethodDecl(hasName("compare"))), hasArgument(0, declRefExpr().bind("str2")), callee(memberExpr(has(declRefExpr().bind("str1"))))))))).bind("case1") This one bind to both str1 and str2 in
2011 Mar 22
1
GSOC 2011 : Weighting Schemes and Matcher Optimisations
Hello, My name is Santiago Pina and I am currently studying two BSc(Hon) simultaneously ; one in Computer Science and the other in Mathematics as part of a pilot project at Universidad de Murcia. I am very excited to contribute in open source community through the platform of Google Summer of Code 2011. I was interested in the Weighting Schemes project and in the Matcher Optimisations project,
2020 Feb 19
2
i1 true ^= -1 in DAG matcher?
The vnot PatFrag uses ImmAllOnesV which should put an OPC_CheckImmAllOnesV in the matcher table. And the matcher table should call ISD::isBuildVectorAllOnes. I believe we use vnot with vXi1 vectors on X86 and I haven't seen any issues. The FIXME you pointed to seems related to a scalar patcher not a vector pattern. In that case the issue is that the immediate matcher for scalars calls
2016 Nov 28
2
Looking for help with an ast matcher
Hi Piotr, Thanks. Yeah, it seemed a little weird, but it was what got me closest. I found out that the matcher I supplied here was working for clang-query 3.8.1. I'm working on a clang-tidy module for 4.0.0 - it's not working there. Could you elaborate on the "onImplicitObjectArgument"? There is no document on it on the clang page. So I wouldn't know how it works or what it
2009 Apr 02
8
Problem with Custom matcher and Blocks
Hi, I''m trying to write my first custom matcher. Here''s a bit of my example group. describe "/contact/index" do include FormMatchers before(:each) do render ''contact/index'' end it "should show the contact form" do response.should have_a_contact_form end describe "the contact form" do context
2007 May 19
2
have_text matcher does not support should_not.
Hello Guys, Doing conversion of some test for some controllers, still with integrated views. Anyway, I have this: it "should not see Join This Group button on profile page as member" do get "show", :id => @group.id response.should be_success response.should_not have_text(/Join This Group/) end But running with spec (0.9.4), drop me the folling error:
2020 Feb 19
2
i1 true ^= -1 in DAG matcher?
Hello, It looks like that in the DAG matcher, the DAG has a xor with '-1' for checking a true value vector for instance, %cmp4.i = icmp ne <8 x i32> %6, %5 %7 = xor <8 x i1> %cmp4.i, <i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true> [use of %7] results in vector of '-1' in the DAG. This also seems the reason why LLVM's vnot PatFrag
2012 Jan 26
2
[LLVMdev] HELP - tblgen -gen-asm-matcher restrictions on .td content
I'm trying to generate MipsGenAsmMatcher.inc for MipsAsmParser.cpp. What added restrictions for the .td file contents are there for tblgen -gen-asm-matcher? For the Mips platform we create the following .inc files through tblgen. tablegen(LLVM MipsGenRegisterInfo.inc -gen-register-info) tablegen(LLVM MipsGenInstrInfo.inc -gen-instr-info) tablegen(LLVM MipsGenCodeEmitter.inc -gen-emitter)
2016 Jul 26
2
[PATCH] Add support for the 'unless' matcher in the dynamic layer.
Even if it still did add overhead, it seems perfectly reasonable, from a user's perspective (namely mine), that if I introduce unnecessary narrowing matchers to my chain that there may be a performance penalty. The ability to do the following easily outweighs any performance issues for me: anyOf ( /* hasName("..."), */ hasName("...") ) though C++ not allowing
2008 Jan 24
1
Constant definition matcher
Hello all, I need to specify that a class should define a constant. I couldn''t find something such as "should define_const(''MY_CONST'')" in the RSpec documentation, even though there are similar matchers such as "should respond_to". I know I can write the matcher myself (that wouldn''t be so difficult) but is there a reason ? Thanks!
2007 May 28
1
Rails matcher render_template is wrong when using GetText, looking for flexible solution
I have a problem with a mismatch between RSpec Rails and the actual behavior when using GetText, and would be glad for suggestions how to best solve this. When using GetText a failure is reported for the following simplified specification: describe SamplesController, "when requesting /samples" do it "should render index " do get ''index''
2020 Feb 19
2
i1 true ^= -1 in DAG matcher?
A constant i1 is stored as a one bit APInt wrapped in a ConstantInt which is then wrapped in ConstantSDNode for SelectionDAG. The BUILD_VECTOR will just point to the same ConstantSDNode for each element. There is no concept of a sign in the storage. It's just a bit. Whether or not its treated as 1 or negative 1 is going to depend on the code looking at the value including printing code. And