[rspec-users] Is it possible to access Example scope from Formatter?

2009-10-18 Thread Jarmo Pertman
Hello. I'm using Watir to perform some user interface tests. I've made my own custom html formatter to make a screenshot and capture html of the page, on which some spec fails. Now, the problem is simple - I have to access the browser object from my formatter to get window handle (for screenshot)

[rspec-users] Is it possible to access Example scope from Formatter?

2009-10-18 Thread Jarmo Pertman
Hello. I'm using Watir to perform some user interface tests. I've made my own custom html formatter to make a screenshot and capture html of the page, on which some spec fails. Now, the problem is simple - I have to access the browser object from my formatter to get window handle (for screenshot)

Re: [rspec-users] Is it possible to access Example scope from Formatter?

2009-10-19 Thread Jarmo Pertman
Thank you for the reply! I have to admit that for a second I thought about using 'options' somehow, but wasn't sure if it would work or not so i forgot the possibility to use it at all and tried different approaches. Anyway, it seems that your exact code snippet doesn't work so I made one formatt

[rspec-users] how to pass objects from spec to formatter from before :all block?

2010-03-06 Thread Jarmo Pertman
Hello. I need to pass something from before :all to formatter. I know that i could use options hash from spec and then get the value back in formatter, but it doesn't work when i'm doing it from before :all. So, this work: # in spec before :each do options[:something] = 1 end # in formatter d

Re: [rspec-users] how to pass objects from spec to formatter from before :all block?

2010-03-06 Thread Jarmo Pertman
tions? Any other solutions? Jarmo On Mar 6, 7:28 pm, David Chelimsky wrote: > On Sat, Mar 6, 2010 at 11:09 AM, Jarmo Pertman wrote: > > Hello. > > > I need to pass something from before :all to formatter. I know that i > > could use options hash from spec and then get th

Re: [rspec-users] how to pass objects from spec to formatter from before :all block?

2010-03-07 Thread Jarmo Pertman
great of course if i wouldn't have to fill options two times. Jarmo On Mar 7, 3:12 pm, David Chelimsky wrote: > On Sat, Mar 6, 2010 at 12:33 PM, Jarmo Pertman wrote: > > Since i'm using Watir > > then i usually open up the browser in > > before :all block like this: &

[rspec-users] accessing constants from another module within examples

2010-06-16 Thread Jarmo Pertman
Hello. I wanted to include module into ExampleGroup to write less code within examples, but was unable to do so. This seems to be strange, because in regular Class it works and all methods within that module are also accessible. See the example: module MyModule MyConstant = 1 def my_method

Re: [rspec-users] accessing constants from another module within examples

2010-06-16 Thread Jarmo Pertman
Why do you think that it's not working in regular Ruby either? Check the following example to see that it does: module MyModule MyConstant = 1 def my_method 2 end end class MyClass include MyModule def initialize p my_method p MyModule::MyConstant p MyConstant end end

Re: [rspec-users] accessing constants from another module within examples

2010-06-16 Thread Jarmo Pertman
Done! Jarmo On Jun 16, 5:22 pm, David Chelimsky wrote: > Seems like a bug. Please submit it > tohttp://github.com/rspec/rspec-core/issuesfor > rspec-2,http://rspec.lighthouseapp.comto make sure it gets backported to > rspec-1. > > Thx, > David ___ r

[rspec-users] about spec.opts and command line options and global options

2010-07-28 Thread Jarmo Pertman
ine options with spec.opts - e.g have higher priority for command line options, BUT preserve spec.opts if they're not overridden. 3) Make spec.opts to handle Ruby code. 4) Allow some way to specify global configuration options for RSpec. I'm using RSpec 1.3.0 and don&#

Re: [rspec-users] about spec.opts and command line options and global options

2010-07-28 Thread Jarmo Pertman
Thank You! If i understand correctly, then all the problems except #3 have been solved in RSpec 2? Nice that there are people with similar thoughts :) Jarmo Pertman - IT does really matter - http://www.itreallymatters.net On Jul 28, 10:27 pm, David Chelimsky wrote: > I thinkh

[rspec-users] autotest not working on Windows with rails3 and rspec2?

2010-10-22 Thread Jarmo Pertman
Hello! I'm trying to run autotest under Windows when using Rails 3.0.1 and RSpec 2.0.1. It's not working so far. This is what happens: C:\Users\jarmo\Desktop\minu\projects\Ruby\sample_app>autotest loading autotest/rails_rspec2 style: RailsRspec2 bundle exec C:\bin\pik\Ruby-187-p302\bin\ruby -S C:/

Re: [rspec-users] autotest not working on Windows with rails3 and rspec2?

2010-10-24 Thread Jarmo Pertman
No ideas, what might cause that problem? Could it be a Windows-only- issue? Jarmo On Oct 22, 3:46 pm, Jarmo Pertman wrote: > Hello! > > I'm trying to run autotest under Windows when using Rails 3.0.1 and > RSpec 2.0.1. It's not working so far. This is what happens: > C:

[rspec-users] Upgrade problems/questions regarding RSpec 1.3.0 to 2.0.1

2010-11-04 Thread Jarmo Pertman
Hello! I'm trying to migrate my scripts from RSpec 1.3.0 to 2.0.1 having some issues so far. 1) I don't like is that ".rspec" has to be in the working directory and cannot be anymore in "spec". Okay, i can issue "mv spec/ spec.opts .rspec" in my projects, but why isn't it supported? 2) If there

Re: [rspec-users] Upgrade problems/questions regarding RSpec 1.3.0 to 2.0.1

2010-11-04 Thread Jarmo Pertman
On Nov 4, 9:21 pm, Jarmo Pertman wrote: > 3) Why does html formatter snippet show always failing line as: >   raise(RSpec::Expectations::ExpectationNotMetError.new(message)) > > in 1.x it would show the failing line in the spec file instead... is > this a bug? I cannot reprodu

Re: [rspec-users] Upgrade problems/questions regarding RSpec 1.3.0 to 2.0.1

2010-11-04 Thread Jarmo Pertman
On Nov 4, 9:52 pm, Jarmo Pertman wrote: > I cannot reproduce this problem currently with standard html formatter > although i don't do anything with snippet extractor in my custom html > formatter. I need to investigate why the problem happens now and then. I've managed to rep

Re: [rspec-users] Upgrade problems/questions regarding RSpec 1.3.0 to 2.0.1

2010-11-04 Thread Jarmo Pertman
rcov -Ispec "./spec/my_lib_spec.rb" failed It will pass of course if i'll add `require "rspec"` to somewhere. Jarmo Pertman - IT does really matter - http://www.itreallymatters.net ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Upgrade problems/questions regarding RSpec 1.3.0 to 2.0.1

2010-11-04 Thread Jarmo Pertman
Extensions, Kernel] So, for some reason the module is not included when running with RCov. By the way all the specs were working before with 1.3.0. Jarmo Pertman - IT does really matter - http://www.itreallymatters.net On Nov 4, 10:37 pm, Jarmo Pertman wrote: > There seems to be also a pr

Re: [rspec-users] Upgrade problems/questions regarding RSpec 1.3.0 to 2.0.1

2010-11-04 Thread Jarmo Pertman
y if some of the problems in this thread are already fixed in master, but i couldn't see any open bugs relating to any of the problems described here. Waiting for some solutions-explanations how to solve most of the problems hopefully. Jarmo Pertman - IT does r

Re: [rspec-users] Upgrade problems/questions regarding RSpec 1.3.0 to 2.0.1

2010-11-05 Thread Jarmo Pertman
I'd wait for some preliminary answers from you or anyone else from core before opening up any new issues. The main blockers for me to start using RSpec 2 are currently the subject {self} and html formatter snippet problems. Hopefully you'll find some time to answer to my provided feedba

Re: [rspec-users] Upgrade problems/questions regarding RSpec 1.3.0 to 2.0.1

2010-11-05 Thread Jarmo Pertman
I didn't refresh my browser before writing that reply thus didn't see that you had already answered. Going to create those issues soon. Thanks for your feedback! Jarmo On Nov 5, 5:06 pm, David Chelimsky wrote: > On Nov 5, 2010, at 7:02 AM, Jarmo Pertman wrote: > >

Re: [rspec-users] Upgrade problems/questions regarding RSpec 1.3.0 to 2.0.1

2010-11-05 Thread Jarmo Pertman
cess the ExampleGroup from the Example instance it's already too late since ExampleGroup description might be already flushed to the report. Haven't tried that yet though. Hopefully you understand my concern better now. Jarmo Pertman ___ rspec

Re: [rspec-users] Upgrade problems/questions regarding RSpec 1.3.0 to 2.0.1

2010-11-05 Thread Jarmo Pertman
#x27;t include modules into example groups with RSpec.configure https://github.com/rspec/rspec-core/issues/issue/216 6) Subject#subject {self} causes stack overflow: https://github.com/rspec/rspec-core/issues/issue/217 Jarmo Pertman - IT does really matter - http://www.itreallymatters.net On Nov

Re: [rspec-users] autotest not working on Windows with rails3 and rspec2?

2010-11-10 Thread Jarmo Pertman
2\bin\ruby.exe I don't understand who makes that decision what should be executed via bundler - is it RSpec? Rails? Bundler itself? Anyway, maybe someone knows what makes up that exec command so i can open up an issue at correct place. Jarmo On Oct 24, 9:20 pm, Jarmo Pertman wrote: > N

Re: [rspec-users] autotest not working on Windows with rails3 and rspec2?

2010-11-10 Thread Jarmo Pertman
On Nov 10, 4:06 pm, David Chelimsky wrote: > On Nov 10, 2010, at 7:54 AM,JarmoPertmanwrote: > > > I didn't get any replies about that problem so far but i just managed > > to find out how to make it work manually. > > What manual change did you make? > > > The problem is that the bundle exec is no

Re: [rspec-users] autotest not working on Windows with rails3 and rspec2?

2010-11-10 Thread Jarmo Pertman
C:\Users\jarmo\Desktop\minu\projects\Ruby\sample_app>bundle exec c: \Ruby\bin\ruby.exe --version ruby 1.8.6 (2010-02-04 patchlevel 398) [i386-mingw32] Thank you for the tip, David! Jarmo On Nov 10, 4:54 pm, Jarmo Pertman wrote: > On Nov 10, 4:06 pm, David Chelimsky wrote: > > &g

Re: [rspec-users] autotest not working on Windows with rails3 and rspec2?

2010-11-10 Thread Jarmo Pertman
Yup, understood and opened an issue in Bundler since it seems to be the culprit in the end: https://github.com/carlhuda/bundler/issues/issue/832 Just FYI if there's any other Windows/RSpec2/Autotest/Bundler user :) Jarmo On Nov 10, 5:23 pm, David Chelimsky wrote: > On Nov 10, 2010, at 8:54 AM,J

Re: [rspec-users] Upgrade problems/questions regarding RSpec 1.3.0 to 2.0.1

2010-11-10 Thread Jarmo Pertman
Still no pointers about the small problem below? On Nov 5, 10:29 pm, Jarmo Pertman wrote: > On Nov 5, 1:52 pm, David Chelimsky wrote: > > > > 4) In 1.x i modified ExampleGroup's description in my html formatter > > > to have some additional information in i

Re: [rspec-users] autotest not working on Windows with rails3 and rspec2?

2010-11-10 Thread Jarmo Pertman
On Nov 10, 9:56 pm, Luis Lavena wrote: > If you strip down the Bundler part, I'm under the same environment too :P > > While I can complain about Bundler doing weird things on Windows I > decided to stop using it and switched to Isolate and invoke commands > with "rake isolate:sh[autotest]" I'm s

Re: [rspec-users] nested examples in html formatter

2010-12-15 Thread Jarmo Pertman
Just FYI, it is now: https://github.com/rspec/rspec-core/commit/edb7f851a85ffe318a5d9d161c896bde448b61e1 Jarmo Pertman - IT does really matter - http://www.itreallymatters.net On Dec 14, 3:25 pm, David Chelimsky wrote: > On Dec 13, 2010, at 10:46 PM, Jonathan Linowes wrote: > > &

[rspec-users] added new cool matcher into my framework WatirSplash - #in

2011-04-16 Thread Jarmo Pertman
ore meaning to numbers require "active_support" div.should exist.in(2.minutes) What do you guys think? Should i add that also into rspec-expectations to make spec-ing easier where timing is involved? :) Jarmo Pertman - IT does really matter - http://www.itreallymatters.net __

Re: [rspec-users] added new cool matcher into my framework WatirSplash - #in

2011-04-18 Thread Jarmo Pertman
01 AM, David Chelimsky wrote: > > > > > > > > > > > On Apr 16, 2011, at 4:56 PM, Jarmo Pertman wrote: > > > > Hello! > > > > I've just added a new cool matcher #in into my framework WatirSplash > > > and thought that this could

Re: [rspec-users] added new cool matcher into my framework WatirSplash - #in

2011-04-18 Thread Jarmo Pertman
On Apr 18, 4:21 pm, David Chelimsky wrote: > > but it doesn't > > conflict with matcher's #in anyway. > > It conflicts with the name :) It's a problem when we have one name that means > completely different things in different contexts. It depends :) That's the point of OOP that the methods wit

Re: [rspec-users] added new cool matcher into my framework WatirSplash - #in

2011-04-19 Thread Jarmo Pertman
On Apr 18, 5:59 pm, David Chelimsky wrote: > What do you think of within(n).seconds { ... }? I'm not sure i understand it fully taking into account the examples above. Let me try to write them below: expect { link.click }.to change {div.text}.from("before").to("after").within(2).seconds link

Re: [rspec-users] added new cool matcher into my framework WatirSplash - #in

2011-04-20 Thread Jarmo Pertman
On Apr 19, 4:08 pm, David Chelimsky wrote: > OK - I think I understand this better from this example. The idea here is > that the matcher should keep asking if div.text == "after" until it returns > true or 2 seconds have passed, whichever comes first, after which it fails. > Correct? If so, th

Re: [rspec-users] added new cool matcher into my framework WatirSplash - #in

2011-04-25 Thread Jarmo Pertman
No opinions on this anymore? Jarmo ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

[rspec-users] RSpec 2 not finding specs from subdirectories when trying to run specs from there

2011-06-01 Thread Jarmo Pertman
Hi! When having a file structure like this: project -spec -subdir -my_spec.rb and then being in directory "project" and running command `rspec spec` everything works as expected. If running `rspec spec/subdir` to run only specs under spec/subdir then it doesn't work - it finds 0 examp

[rspec-users] how to include module into shared example group in RSpec 2

2011-06-01 Thread Jarmo Pertman
Hi! We tried to upgrade our RSpec from 1.3.1 to 2.6 and are having some problems. It seems that shared example group includes modules differently in RSpec 2. Consider the following code: module MyModule def testing end end shared_examples_for "shared" do include MyModule it "works" do

[rspec-users] how to include module into shared example group in RSpec 2

2011-06-01 Thread Jarmo Pertman
Hi! We tried to upgrade our RSpec from 1.3.1 to 2.6 and are having some problems. It seems that shared example group includes modules differently in RSpec 2. Consider the following code: module MyModule def testing end end shared_examples_for "shared" do include MyModule it "works" do te

Re: [rspec-users] RSpec 2 not finding specs from subdirectories when trying to run specs from there

2011-06-01 Thread Jarmo Pertman
, 1.3.0) rspec-core (2.6.3, 2.5.1, 2.3.1, 2.3.0, 2.2.1, 2.1.0) rspec-expectations (2.6.0, 2.5.0, 2.3.0, 2.2.0, 2.1.0) rspec-mocks (2.6.0, 2.5.0, 2.3.0, 2.2.0, 2.1.0) rspec-rails (2.3.1, 2.1.0) Jarmo On Jun 1, 5:24 pm, David Chelimsky wrote: > On Jun 1, 2011, at 9:14 AM, Jarmo Pertman wrot

Re: [rspec-users] RSpec 2 not finding specs from subdirectories when trying to run specs from there

2011-06-01 Thread Jarmo Pertman
unix-slashes... Jarmo On Jun 1, 5:24 pm, David Chelimsky wrote: > On Jun 1, 2011, at 9:14 AM, Jarmo Pertman wrote: > > > Hi! > > > When having a file structure like this: > > project > >  -spec > >    -subdir > >      -my_spec.rb > > > and

Re: [rspec-users] how to include module into shared example group in RSpec 2

2011-06-01 Thread Jarmo Pertman
Thank you :) Where can i see the differences between #it_should_behave_like, #include_context and #include_examples? Jarmo On Jun 1, 5:42 pm, David Chelimsky wrote: > On Jun 1, 2011, at 9:10 AM, Jarmo Pertman wrote: > > > > > > > > > > > Hi! > > >

Re: [rspec-users] how to include module into shared example group in RSpec 2

2011-06-01 Thread Jarmo Pertman
Done https://github.com/rspec/rspec-core/issues/396 Jarmo On Jun 1, 6:05 pm, David Chelimsky wrote: > On Jun 1, 2011, at 10:05 AM, Jarmo Pertman wrote: > > > Thank you :) > > > Where can i see the differences between #it_should_behave_like, > > #include_context and

[rspec-users] how to modify RSpec.configuration correctly depending of the example groups

2011-07-22 Thread Jarmo Pertman
Hi! I have a directory structure something similar to: spec/a/a_helper.rb spec/a/a_spec.rb spec/b/b_spec.rb In a_helper.rb i'd like to do something like this: RSpec.configure do |config| config.before :each do # do something for every example under "a" directory end end It works okay if

Re: [rspec-users] [RSpec] implicit receiver for should problem when helper predicate methods are in use

2009-05-07 Thread Jarmo Pertman
Okay, I fiddled around a little and made this solution: module Spec module Example module Subject module ExampleMethods def should(matcher=nil) if matcher self == subject ? Spec::Expectations::PositiveExpectationHandler.handle_matcher(self, matcher) : subj

Re: [rspec-users] [RSpec] implicit receiver for should problem when helper predicate methods are in use

2009-05-07 Thread Jarmo Pertman
I think that I don't understand what you mean by that exactly. I mean, I patched the should and should_not methods in moule Subject::ExampleMethods themselves, which means that this changes only behaviour of subject itself e.g. it is already part of RSpec and don't see how it would break matchers o

Re: [rspec-users] [RSpec] implicit receiver for should problem when helper predicate methods are in use

2009-05-08 Thread Jarmo Pertman
On May 8, 10:50 am, David Chelimsky wrote: > This is pretty helpful, thanks for a more thorough explanation. I did > add your patch locally, however, and it doesn't seem to solve the > problem (I still get undefined method `ok?' when I run the example in > your 2nd post). Sorry. It didn't work b

Re: [rspec-users] [RSpec] implicit receiver for should problem when helper predicate methods are in use

2009-05-08 Thread Jarmo Pertman
Added patch and specs to https://rspec.lighthouseapp.com/projects/5645-rspec/tickets/816-possibility-to-use-self-as-a-subject-for-explicit-receiver Jarmo ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-u

Re: [rspec-users] [RSpec] implicit receiver for should problem when helper predicate methods are in use

2009-05-11 Thread Jarmo Pertman
Thanks for adding this change into repo! I'm quite surprised that anyone else haven't stumbled upon this problem yet. I guess it's because most of spec'ing is done for Ruby projects, so this functionality is not needed. I have been thinking a little more about this topic and asked myself: why not

Re: [rspec-users] [RSpec] implicit receiver for should problem when helper predicate methods are in use

2009-05-13 Thread Jarmo Pertman
On May 12, 6:21 am, David Chelimsky wrote: > > I don't want to promote using self as subject. I think being able to > do so explicitly, as we can now with your previous patch, is perfectly > reasonable. But doing so is a bit of a trick in my view, and runs > counter to the overall intent of the st

Re: [rspec-users] [RSpec] implicit receiver for should problem when helper predicate methods are in use

2009-05-13 Thread Jarmo Pertman
On May 13, 7:08 pm, David Chelimsky wrote: > > I actually think that what you're doing is perfectly fine. Just not > the common case. That's why I think it's OK to support explicitly > assigning self as subject, but not making that a default behaviour. > > If it were me, and it's *not*, but if i

[rspec-users] [rspec] http://rspec.info examples are broken

2009-05-25 Thread Jarmo Pertman
It seems that some examples at http://rspec.info are broken with invalid html. For example: http://rspec.info/documentation/before_and_after.html All those spans there should not be visible, I think :) Isn't rspec.info web tested well enough? :P Best regards, Jarmo __

Re: [rspec-users] [rspec] http://rspec.info examples are broken

2009-05-27 Thread Jarmo Pertman
On May 25, 10:43 pm, aslak hellesoy wrote: > > It seems that some examples athttp://rspec.infoare broken with > > invalid html. > > > For example:http://rspec.info/documentation/before_and_after.html > > I assume you're referring > to:http://validator.w3.org/check?uri=http%3A%2F%2Frspec.info%2Fdo

[rspec-users] autospec runs failing specs forever in endless loop

2009-05-31 Thread Jarmo Pertman
I wanted to start using autospec on my little (non-Rails) project. I'm on Windows XP and have used it some time ago successfully (on the same PC), although I've updated many gems in the meantime (RSpec for example among others). In short, everything is fine when all specs pass, but if some fails,

Re: [rspec-users] autospec runs failing specs forever in endless loop

2009-06-01 Thread Jarmo Pertman
uation where failing reason is shown on 2 lines? - Why won't anything puts'ed from autotest/discover.rb or autotest/ rspec.rb like they aren't loaded? - Any other reasons why autotest behaviour might be broken? Jarmo On Jun 1, 12:56 am, David Chelimsky wrote: > On Sun, May 31, 200

Re: [rspec-users] autospec runs failing specs forever in endless loop

2009-06-02 Thread Jarmo Pertman
Ok. I've created failing example. Just create project directory and spec directory into it and add there one spec file: describe "autospec" do it "fails" do "hi".should eql("hello") end end It fails, but for autotest it is still green (thus making growl and snar

Re: [rspec-users] autospec runs failing specs forever in endless loop

2009-06-02 Thread Jarmo Pertman
Done at https://rspec.lighthouseapp.com/projects/5645-rspec/tickets/832-autotest-not-detecting-failing-examples-correctly-when-matcher-outputs-multiple-lines-of-information I started even before you've replied, because that bugged me too much :) Jarmo On Jun 2, 7:50 pm, David Chelimsky wrote: >

Re: [rspec-users] Autospec Infinite Loop ??

2009-06-12 Thread Jarmo Pertman
Do you have any files, which might be changed during your failing tests? Some temporary files or whatsoever? If that's the case, then autotest thinks that you have made some changes already and tries to run again. Solution would be to put that file into ignore list for autotest. On Jun 10, 6:28 am