Comments (10)
Not sure yet…
Instead of printing to stdout, try printing to stderr:
$stderr.puts "during monkey patch"
If specjour doesn't find any listeners, it forks one, pointing the child's stdout to a StringIO.
from specjour.
Hi again,
1st : I forgot to mention that the error was :
Failure/Error: login_as(user)
NoMethodError:
undefined method `login_as' for #<RSpec::Core::ExampleGroup::Nested_6::Nested_2:0x007fcf91b540b0>
I tried many things also your $stderr.puts
.
I have the feeling now that there is something wrong with the loading of spec_helper.rb.
Can you tell me if rspec configure is supported by specjour?
#./spec/spec_helper.rb
RSpec.configure do |config|
config.before(:each) do
$stderr.puts "before each"
end
config.include Warden::Test::Helpers
end
This is printing with Rspec, but not with specjour.
I tried also to write this to a file to avoid confusion with outputs, same result. (working with rspec but not specjour)
That's maybe why my login_as
method is not loaded? Just a guess..
Thanks for your help again
from specjour.
Specjour initializes the environment by loading your spec_helper (https://github.com/sandro/specjour/blob/master/lib/specjour/rspec/preloader.rb#L4).
I successfully added this to my spec_helper, and it worked fine.
config.before do
$stderr.puts 'hi foo'
end
Are you running the latest version of specjour? Type specjour version
. I'm running 0.6.4
Note, specjour may not properly handle config.before(:all)
. Specjour runs every example in isolation, which means before(:all)
likely becomes a before(:each)
. I should fix that, but in the meantime, a specjour hook could mimic before(:all)
.
Try using a debugger…
# spec/spec_helper.rb
RSpec.configure do |config|
config.before do
debugger
1
end
end
If that doesn't work, then we got some issues.
from specjour.
I'm running 0.6.4.
I tried with a debugger also, same result.
I tried with a small project, I have the same behavior.
I tried on another machine (Gentoo) used to make our tests also, same behavior.
I'll cook a simple Gentoo with just ruby and specjour, and I'll try with my little project.
(I think it is an incompatibility with another Gem)
I'll let you know. Thanks again for your time!
from specjour.
I'm pretty sure, there is a bug there.
I tested it with a fresh VM and I found a way to demonstrate it.
I'm using the code of specjour to demonstrate it.
The idea is to initialize a global variable in a config.before
and watch from the debugger if this variable is initialized or not.
The modification is here : pierreozoux/specjour@master...issue43
So you can test, like this:
git clone [email protected]:pierreozoux/specjour.git
cd specjour
git checkout issue43
rake
...
(rdb:1) p $toto
1
...
specjour
...
(rdb:1) p $toto
nil #here should be 1
I reproduced this with my mac, and my freshly cooked Gentoo.
Can you tell me if you can reproduce it?
I'm quiet new to ruby, but I'll try to correct it. If you have some advice, please do not hesitate, and thanks for the debug, I didn't know ;)
from specjour.
Oh! I just thought of something… what version of RSpec are you running? I think specjour is incompatible with the latest version of RSpec (which has slipped my mind). I'm successfully running specjour with rspec-core 2.9.0.
from specjour.
Ok, here we are :)
rspec -v
2.11.1
So be careful, when you update your system :)
I'll try right now to run with 2.9
, and why not, try to find a patch to support 2.11.1
;)
Thanks,
Pierre
from specjour.
Pretty sure the patch will be all about RSpec.reset. I use reset in specjour/loader.rb. Check rspec/rspec-core#621
from specjour.
Perfect!
It's working like a charm with my code! (in fact, I used the monkey patch for my code, but was waiting for some results to publish it here) I'm still having issues with cucumber, I'm investigating, and I'll let you know.
When it will be implemented, I'll send you the time saved for each build thanks to you :)
And we'll send a tweet (we, with my colleagues, are working on a new licence for free software based on beerware, it'll be called TweetWare :) )
from specjour.
Great, look forward to hearing about your success.
I haven't used cucumber for about a year, so I'm certain specjour is out of date with the latest. I haven't made time to work on the update. I'll dig in to it soon, and push a release.
from specjour.
Related Issues (20)
- 0.5.3 won't run with thor-0.15.2 HOT 1
- 0.5.3 prepares but won't run with rspec 2.10.0 HOT 5
- Specjour doesn't work with latest cucumber version HOT 2
- Seems to be incompatible with rspec-core 2.10.1 (fine with 2.10.0) HOT 12
- undefined method `step_mother' for Cucumber::Cli::Main:Class HOT 1
- Using specjour with Rails 3.2 HOT 2
- Rspec-core current dev > 2.11.1 HOT 5
- cucumber or akephalos error? HOT 2
- Run with cucumber issue HOT 1
- rsync error - should specjour lisrten quit? HOT 2
- Specjour slow when before(:all) is heavily used HOT 7
- Worker tiemout feature? HOT 3
- Not playing well with rspec-core 2.11.1 HOT 3
- Is this project still in development? HOT 7
- Rails 4 compatibility HOT 2
- DNSSD error HOT 2
- Specjour does not work with cucumber version >= 1.2.2 HOT 1
- RSpec 3 - backtrace_clean_patterns HOT 1
- Is this project still alive?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from specjour.