Sundae Oliseh
2010-Nov-25 15:18 UTC
[Ironruby-core] no such file to load -- spec/story (LoadError)
Hi Guys, I''m trying to run the following script: require ''rubygems'' require ''spec/story'' steps_for(:product_x) do Given("Product $productName at $price") do |productName, price| pending "Need to complete implementation for accessing C# object" end When("user requests a $amount user license") do |amount| pending "Need to complete implementation for accessing C# object" end When("this does not include support") do pending "Need to complete implementation for accessing C# object" end Then("the price should be $price") do |price| pending "Need to complete implementation for accessing C# object" end end with_steps_for(:product_x) do run File.dirname(__FILE__) + "/pricing_scenarios_for_product_x" end And I get this error: C:/Program Files/IronRuby 1.0/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: 31:in `require'': no such file to load -- spec/story (LoadError) from C:/Program Files/IronRuby 1.0/lib/ruby/site_ruby/1.8/rubygems/custo m_require.rb:31:in `require'' from pricing_scenarios_for_product_x_story.rb:2 Any ideas of what I''m doing wrong? Thanks for any attention. -- Posted via http://www.ruby-forum.com/.
Sundae Oliseh
2010-Nov-26 19:15 UTC
[Ironruby-core] no such file to load -- spec/story (LoadError)
I stumbled on this link...very similar to the problem I''m having http://old.nabble.com/New-setup-error.-no-such-file-to-load----spec-story-td23590218.html They suggest to run this: script/generate rspec how do I run it? When I paste it Ironruby command prompt I get the following message: ''script'' is not recognized as an internal or external command, operable program or batch file. Anybody ? Sundae Oliseh wrote in post #963907:> Hi Guys, > > I''m trying to run the following script: > > require ''rubygems'' > require ''spec/story'' > > steps_for(:product_x) do > Given("Product $productName at $price") do |productName, price| > pending "Need to complete implementation for accessing C# object" > end > When("user requests a $amount user license") do |amount| > pending "Need to complete implementation for accessing C# object" > end > When("this does not include support") do > pending "Need to complete implementation for accessing C# object" > end > Then("the price should be $price") do |price| > pending "Need to complete implementation for accessing C# object" > end > end > > with_steps_for(:product_x) do > run File.dirname(__FILE__) + "/pricing_scenarios_for_product_x" > end > > > And I get this error: > > C:/Program Files/IronRuby > 1.0/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: > 31:in `require'': no such file to load -- spec/story (LoadError) > from C:/Program Files/IronRuby > 1.0/lib/ruby/site_ruby/1.8/rubygems/custo > m_require.rb:31:in `require'' > from pricing_scenarios_for_product_x_story.rb:2 > > Any ideas of what I''m doing wrong? > > Thanks for any attention.-- Posted via http://www.ruby-forum.com/.
Shay Friedman
2010-Nov-26 21:06 UTC
[Ironruby-core] no such file to load -- spec/story (LoadError)
script/generate is for rspec-rails (which is a rails plug-in). I seems like you''re not testing a rails app, so you need to install the rspec gem in order to use it. Have you done that? Shay. On Fri, Nov 26, 2010 at 9:15 PM, Sundae Oliseh <lists at ruby-forum.com> wrote:> I stumbled on this link...very similar to the problem I''m having > > > http://old.nabble.com/New-setup-error.-no-such-file-to-load----spec-story-td23590218.html > > They suggest to run this: script/generate rspec > > how do I run it? When I paste it Ironruby command prompt I get the > following message: > > ''script'' is not recognized as an internal or external command, > operable program or batch file. > > Anybody ? > > > Sundae Oliseh wrote in post #963907: > > Hi Guys, > > > > I''m trying to run the following script: > > > > require ''rubygems'' > > require ''spec/story'' > > > > steps_for(:product_x) do > > Given("Product $productName at $price") do |productName, price| > > pending "Need to complete implementation for accessing C# object" > > end > > When("user requests a $amount user license") do |amount| > > pending "Need to complete implementation for accessing C# object" > > end > > When("this does not include support") do > > pending "Need to complete implementation for accessing C# object" > > end > > Then("the price should be $price") do |price| > > pending "Need to complete implementation for accessing C# object" > > end > > end > > > > with_steps_for(:product_x) do > > run File.dirname(__FILE__) + "/pricing_scenarios_for_product_x" > > end > > > > > > And I get this error: > > > > C:/Program Files/IronRuby > > 1.0/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: > > 31:in `require'': no such file to load -- spec/story (LoadError) > > from C:/Program Files/IronRuby > > 1.0/lib/ruby/site_ruby/1.8/rubygems/custo > > m_require.rb:31:in `require'' > > from pricing_scenarios_for_product_x_story.rb:2 > > > > Any ideas of what I''m doing wrong? > > > > Thanks for any attention. > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20101126/0367941c/attachment.html>
Cory Foy
2010-Nov-26 21:20 UTC
[Ironruby-core] no such file to load -- spec/story (LoadError)
Hi Sundae, generate is a ruby command in the script folder of a Rails app. Unless you are working in a Rails app, it won''t be available. If you *are* working in a Rails app, but on a Windows machine, then trying running "ir script/generate rspec". I think that''s right. I know in Ruby it would be "ruby script/generate rspec". You are telling the interpreter to execute the file "generate" in the folder called "script" passing the argument "rspec" to it. Have you installed rspec in your gems? Cory On 11/26/2010 2:15 PM, Sundae Oliseh wrote:> I stumbled on this link...very similar to the problem I''m having > > http://old.nabble.com/New-setup-error.-no-such-file-to-load----spec-story-td23590218.html > > They suggest to run this: script/generate rspec > > how do I run it? When I paste it Ironruby command prompt I get the > following message: > > ''script'' is not recognized as an internal or external command, > operable program or batch file. > > Anybody ? > > > Sundae Oliseh wrote in post #963907: >> Hi Guys, >> >> I''m trying to run the following script: >> >> require ''rubygems'' >> require ''spec/story'' >> >> steps_for(:product_x) do >> Given("Product $productName at $price") do |productName, price| >> pending "Need to complete implementation for accessing C# object" >> end >> When("user requests a $amount user license") do |amount| >> pending "Need to complete implementation for accessing C# object" >> end >> When("this does not include support") do >> pending "Need to complete implementation for accessing C# object" >> end >> Then("the price should be $price") do |price| >> pending "Need to complete implementation for accessing C# object" >> end >> end >> >> with_steps_for(:product_x) do >> run File.dirname(__FILE__) + "/pricing_scenarios_for_product_x" >> end >> >> >> And I get this error: >> >> C:/Program Files/IronRuby >> 1.0/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: >> 31:in `require'': no such file to load -- spec/story (LoadError) >> from C:/Program Files/IronRuby >> 1.0/lib/ruby/site_ruby/1.8/rubygems/custo >> m_require.rb:31:in `require'' >> from pricing_scenarios_for_product_x_story.rb:2 >> >> Any ideas of what I''m doing wrong? >> >> Thanks for any attention. >
Sundae Oliseh
2010-Nov-26 22:19 UTC
[Ironruby-core] no such file to load -- spec/story (LoadError)
Thanks for the replies guys. Indeed I''m *not* testing a rails application. I have installed rspec. here''s the output from the installation: C:\IronRuby\bin>igem install rspec ************************************************** Thank you for installing rspec-core-2.1.0 Please be sure to look at the upgrade instructions to see what might have changed since the last release: http://github.com/rspec/rspec-core/blob/master/Upgrade.markdown ************************************************** Successfully installed rspec-core-2.1.0 Successfully installed diff-lcs-1.1.2 Successfully installed rspec-expectations-2.1.0 Successfully installed rspec-mocks-2.1.0 Successfully installed rspec-2.1.0 5 gems installed Installing ri documentation for rspec-core-2.1.0... Installing ri documentation for diff-lcs-1.1.2... Installing ri documentation for rspec-expectations-2.1.0... Installing ri documentation for rspec-mocks-2.1.0... Installing ri documentation for rspec-2.1.0... Installing RDoc documentation for rspec-core-2.1.0... Installing RDoc documentation for diff-lcs-1.1.2... Installing RDoc documentation for rspec-expectations-2.1.0... Installing RDoc documentation for rspec-mocks-2.1.0... Installing RDoc documentation for rspec-2.1.0... -- Posted via http://www.ruby-forum.com/.
Cory Foy
2010-Nov-27 00:21 UTC
[Ironruby-core] no such file to load -- spec/story (LoadError)
Hi Sundae, Are you running this from a tutorial? If I remember correctly, spec/story was the old StoryRunner for RSpec, which was deprecated since most everyone uses Cucumber for Story Writing. Do you have the link to the tutorial you are using? Cory On 11/26/2010 5:19 PM, Sundae Oliseh wrote:> Thanks for the replies guys. > > Indeed I''m *not* testing a rails application. > > I have installed rspec. > > here''s the output from the installation: > > C:\IronRuby\bin>igem install rspec > ************************************************** > > Thank you for installing rspec-core-2.1.0 > > Please be sure to look at the upgrade instructions to see what might > have > changed since the last release: > > http://github.com/rspec/rspec-core/blob/master/Upgrade.markdown > > ************************************************** > Successfully installed rspec-core-2.1.0 > Successfully installed diff-lcs-1.1.2 > Successfully installed rspec-expectations-2.1.0 > Successfully installed rspec-mocks-2.1.0 > Successfully installed rspec-2.1.0 > 5 gems installed > Installing ri documentation for rspec-core-2.1.0... > Installing ri documentation for diff-lcs-1.1.2... > Installing ri documentation for rspec-expectations-2.1.0... > Installing ri documentation for rspec-mocks-2.1.0... > Installing ri documentation for rspec-2.1.0... > Installing RDoc documentation for rspec-core-2.1.0... > Installing RDoc documentation for diff-lcs-1.1.2... > Installing RDoc documentation for rspec-expectations-2.1.0... > Installing RDoc documentation for rspec-mocks-2.1.0... > Installing RDoc documentation for rspec-2.1.0... >
Sundae Oliseh
2010-Nov-27 01:04 UTC
[Ironruby-core] no such file to load -- spec/story (LoadError)
Hi Cory, That''s an excellent question. As I am an absolute newbie in Ironruby, I''m using these two articles as starting point http://msdn.microsoft.com/en-us/magazine/dd434651.aspx http://msdn.microsoft.com/en-us/magazine/dd453038.aspx Maybe they''re outdated. Cory Foy wrote in post #964185:> Hi Sundae, > > Are you running this from a tutorial? If I remember correctly, > spec/story was the old StoryRunner for RSpec, which was deprecated since > most everyone uses Cucumber for Story Writing. Do you have the link to > the tutorial you are using? > > Cory-- Posted via http://www.ruby-forum.com/.
Cory Foy
2010-Nov-27 04:11 UTC
[Ironruby-core] no such file to load -- spec/story (LoadError)
Hi Sundae, Indeed they are. You want to be looking at Cucumber instead of RSpec for Story support. I''d highly recommend David''s book (which I believe has finally shipped!) http://www.pragprog.com/titles/achbd/the-rspec-book. It''s not about using BDD with IronRuby, but the concepts are still important. I''m not sure what the latest scoop is for Cucumber and IronRuby, but it looks like Shay recently answered a question around it on the Ruby list (http://www.ruby-forum.com/topic/216286) so he might chime in soon with more info for that. But they pointed to the following article (http://blog.webintellix.com/2009/10/how-to-use-cucumber-with-net-and-c.html) which is over a year old now, but I''m assuming still works. Cory On 11/26/10 8:04 PM, Sundae Oliseh wrote:> Hi Cory, > > That''s an excellent question. > As I am an absolute newbie in Ironruby, I''m using these two articles as > starting point > > http://msdn.microsoft.com/en-us/magazine/dd434651.aspx > http://msdn.microsoft.com/en-us/magazine/dd453038.aspx > > Maybe they''re outdated. > > > > Cory Foy wrote in post #964185: >> Hi Sundae, >> >> Are you running this from a tutorial? If I remember correctly, >> spec/story was the old StoryRunner for RSpec, which was deprecated since >> most everyone uses Cucumber for Story Writing. Do you have the link to >> the tutorial you are using? >> >> Cory >
Mike Hatfield
2010-Nov-27 11:07 UTC
[Ironruby-core] no such file to load -- spec/story (LoadError)
Hi Sundae, The articles in MSDN magazine are a little out dated. What versions on IronRuby are you running? You can type in ir -v to get the version. I remember struggling with these articles when I first started out. I''d be happy to give you a hand. Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20101127/5ba92c6f/attachment.html>
Sundae Oliseh
2010-Nov-29 15:38 UTC
[Ironruby-core] no such file to load -- spec/story (LoadError)
Hi Cory, I was suspecting that something was not quite right with RSPEC. I Will take a look at Cucumber instead. I will definitely pick up a copy of that book. Thanks for the recommendation. Cory Foy wrote in post #964205:> Hi Sundae, > > Indeed they are. You want to be looking at Cucumber instead of RSpec for > Story support. > > I''d highly recommend David''s book (which I believe has finally shipped!) > http://www.pragprog.com/titles/achbd/the-rspec-book. It''s not about > using BDD with IronRuby, but the concepts are still important. > > I''m not sure what the latest scoop is for Cucumber and IronRuby, but it > looks like Shay recently answered a question around it on the Ruby list > (http://www.ruby-forum.com/topic/216286) so he might chime in soon with > more info for that. But they pointed to the following article > (http://blog.webintellix.com/2009/10/how-to-use-cucumber-with-net-and-c.html) > which is over a year old now, but I''m assuming still works. > > Cory-- Posted via http://www.ruby-forum.com/.
Sundae Oliseh
2010-Nov-29 15:45 UTC
[Ironruby-core] no such file to load -- spec/story (LoadError)
I''m running IronRuby 1.0.0.0 on .NET 2.0.50727.3615 Mike. Mike Hatfield wrote in post #964264:> Hi Sundae, > > The articles in MSDN magazine are a little out dated. What versions on > IronRuby are you running? You can type in ir -v to get the version. I > remember struggling with these articles when I first started out. I''d > be > happy to give you a hand. > > Mike-- Posted via http://www.ruby-forum.com/.
Sundae Oliseh
2010-Nov-29 16:59 UTC
[Ironruby-core] no such file to load -- spec/story (LoadError)
I am currently following this tutorial: http://blog.webintellix.com/2009/10/how-to-use-cucumber-with-net-and-c.html and I''m stuck on step 4 with the following error: C:\Ruby192\bin>icucumber -help c:/Ruby192/lib/ruby/gems/1.9.1/gems/gherkin-2.2.9-x86-mingw32/lib/gherkin/native /ikvm.rb:16:in `load_assembly'': Assembly ''gherkin'' not found\nTry this: SET MONO _PATH=c:/Ruby192/lib/ruby/gems/1.9.1/gems/gherkin-2.2.9-x86-mingw32/lib (or expo rt MONO_PATH=...) (LoadError) from c:/Ruby192/lib/ruby/gems/1.9.1/gems/gherkin-2.2.9-x86-mingw32/lib/g herkin/native/ikvm.rb:16:in `native_impl'' from c:/Ruby192/lib/ruby/gems/1.9.1/gems/gherkin-2.2.9-x86-mingw32/lib/g herkin/i18n.rb:7 from C:/IronRuby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'' from C:/IronRuby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'' from c:/Ruby192/lib/ruby/gems/1.9.1/gems/gherkin-2.2.9-x86-mingw32/lib/g herkin/lexer/i18n_lexer.rb:1 from C:/IronRuby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'' from C:/IronRuby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'' from c:/Ruby192/lib/ruby/gems/1.9.1/gems/gherkin-2.2.9-x86-mingw32/lib/g herkin.rb:1 from C:/IronRuby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'' from C:/IronRuby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'' from c:/Ruby192/lib/ruby/gems/1.9.1/gems/cucumber-0.9.4/bin/../lib/cucum ber/cli/main.rb:5 from C:/IronRuby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'' from C:/IronRuby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'' from c:/Ruby192/lib/ruby/gems/1.9.1/gems/cucumber-0.9.4/bin/cucumber:5 from C:/Ruby192/bin/cucumber:19:in `load'' from C:/Ruby192/bin/cucumber:19 Sundae Oliseh wrote in post #964772:> I''m running IronRuby 1.0.0.0 on .NET 2.0.50727.3615 Mike. > > Mike Hatfield wrote in post #964264: >> Hi Sundae, >> >> The articles in MSDN magazine are a little out dated. What versions on >> IronRuby are you running? You can type in ir -v to get the version. I >> remember struggling with these articles when I first started out. I''d >> be >> happy to give you a hand. >> >> Mike-- Posted via http://www.ruby-forum.com/.
Mike Hatfield
2010-Nov-29 19:15 UTC
[Ironruby-core] no such file to load -- spec/story (LoadError)
It seems that Cucumber for IronRuby is a little broken at the moment. There''s an issue with Gherkin (the bdd language used by Cucumber and SpecFlow). To get around this, I installed an older version of Cucumber that did not have this dependency. I installed Cucumber 1.6.4 with the command: igem install cucumber -v=1.6.4 It needed iron-term-ansicolor, I installed that with: igem install iron-term-ansicolor To get Cucumber to run with IronRuby, I created a batch file in the IronRuby bin folder called icucumber.bat. My bat file looks like: @ECHO OFF REM This is to tell IronRuby where to find gems. SET GEM_PATH=C:\Users\mike.hatfield.NICOM\.pik\rubies\IronRuby-10v4\lib\ironruby\gems\1.8 @"C:\Users\mike.hatfield.NICOM\.pik\rubies\IronRuby-10v4\bin\ir.exe" "C:\Users\mike.hatfield.NICOM\.pik\rubies\IronRuby-10v4\bin\cucumber" %* Your batch file''s GEM_PATH and executable paths are probably different than mine, I''m running IronRuby with PIK (allows me to run multiple versions of Ruby). I then started the feature from the MSDN article. I had to change "Story:" to "Feature:". My story is: Feature: Pricing for New Product X As a sales administrator, I want to be able to view prices for product x so that I can provide customers with an accurate cost for their requirements. Scenario: Single User License for Product X without support Given Product X When user requests a 1 user license And this does not include support Then the price should be $250 I called this file story.feature and saved it in a folder called features. If you run the following cucumber command, you should get the initial cucumber story run. icucumber features This gives you a list of steps (When clauses) that need to be implemented in your step definitions to make the story pass. Inside the features folder I created another folder called step_definitons. Inside the step_definitons folder, I created a file called product_steps.rb Now, for the .NET class library. I created three class files: *Product.cs* namespace Bdd.Store { public class Product { public string Name { get; set; } public double Price { get; set; } } } *Store.cs* namespace Bdd.Store { public class Store { public Product FindByProductName(string name) { Product product = new Product { Name = name }; return product; } } } *Purchase.cs* namespace Bdd.Store { public class Purchase { public Product Product{ get; set; } public int Licenses { get; set; } public bool IncludesSupport { get; set; } public double GetTotalPurchasePrice() { double price = Product.Price * Licenses; double supportFees = 0.0; if(IncludesSupport) { supportFees = price * 0.10; } return price + supportFees; } } } I then compiled these into an assembly called Product.dll using the CSharp compiler command (run from my Visual Studio Command window): csc /out:Product.dll /target:library Product.cs Store.cs Purchase.cs I then required my Product.dll into my step definitions file ( product_steps.rb) require File.dirname(__FILE__) + "/Product.dll" Just as a convenience, I "include" my Bdd.Store namespace: include Bdd::Store I also require RSepc require "rspec" Lastly, I begin implementing my steps: Given /^Product (.*)$/ do |product| @store = Store.new @product = @store.find_by_product_name(product) @product.price = 250; @product.name.should == product end and so on and so forth. You can download my files from http://webcoding4fun.oakraven.net/downloads/BDD Example with CSharp.zip I hope this helps a little. Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20101129/38fa292c/attachment-0001.html>
Sundae Oliseh
2010-Nov-29 20:30 UTC
[Ironruby-core] no such file to load -- spec/story (LoadError)
Thanks for your very detailled example Mike. I''ve run into some issues while following it: when I run the following statement: igem install cucumber -v=1.6.4 here''s the error message I received: C:\IronRuby\bin>igem install cucumber -v=1.6.4 ERROR: could not find gem cucumber locally or in a repository I searched around the net a little bit and found out that there is an alternative syntax: C:\IronRuby\bin>igem install --source http://gems.rubyforge.org cucumber - v1.6.4 I ran it and got the follwing output (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) Thank you for installing cucumber-0.9.4. Please be sure to read http://wiki.github.com/aslakhellesoy/cucumber/upgrading for important information about this release. Happy cuking! (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) Successfully installed cucumber-0.9.4 ERROR: could not find gem v1.6.4 locally or in a repository 1 gem installed C:/Ruby192/lib/ruby/gems/1.9.1/gems/rdoc-2.5.11/lib/rdoc/ruby_lex.rb:67: warning : parenthesize argument(s) for future version Installing ri documentation for cucumber-0.9.4... Installing RDoc documentation for cucumber-0.9.4... As you can see, there is an error message in there. It did not ultimately install the correct version -- Posted via http://www.ruby-forum.com/.
Tomas Matousek
2010-Nov-29 20:58 UTC
[Ironruby-core] no such file to load -- spec/story (LoadError)
Do these problems manifest when using IronRuby 1.1.2? (master from github). Could you file a bug with details if so? Thanks, Tomas From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Mike Hatfield Sent: Monday, November 29, 2010 11:16 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] no such file to load -- spec/story (LoadError) It seems that Cucumber for IronRuby is a little broken at the moment. There''s an issue with Gherkin (the bdd language used by Cucumber and SpecFlow). To get around this, I installed an older version of Cucumber that did not have this dependency. I installed Cucumber 1.6.4 with the command: igem install cucumber -v=1.6.4 It needed iron-term-ansicolor, I installed that with: igem install iron-term-ansicolor To get Cucumber to run with IronRuby, I created a batch file in the IronRuby bin folder called icucumber.bat. My bat file looks like: @ECHO OFF REM This is to tell IronRuby where to find gems. SET GEM_PATH=C:\Users\mike.hatfield.NICOM\.pik\rubies\IronRuby-10v4\lib\ironruby\gems\1.8 @"C:\Users\mike.hatfield.NICOM\.pik\rubies\IronRuby-10v4\bin\ir.exe" "C:\Users\mike.hatfield.NICOM\.pik\rubies\IronRuby-10v4\bin\cucumber" %* Your batch file''s GEM_PATH and executable paths are probably different than mine, I''m running IronRuby with PIK (allows me to run multiple versions of Ruby). I then started the feature from the MSDN article. I had to change "Story:" to "Feature:". My story is: Feature: Pricing for New Product X As a sales administrator, I want to be able to view prices for product x so that I can provide customers with an accurate cost for their requirements. Scenario: Single User License for Product X without support Given Product X When user requests a 1 user license And this does not include support Then the price should be $250 I called this file story.feature and saved it in a folder called features. If you run the following cucumber command, you should get the initial cucumber story run. icucumber features This gives you a list of steps (When clauses) that need to be implemented in your step definitions to make the story pass. Inside the features folder I created another folder called step_definitons. Inside the step_definitons folder, I created a file called product_steps.rb Now, for the .NET class library. I created three class files: Product.cs namespace Bdd.Store { public class Product { public string Name { get; set; } public double Price { get; set; } } } Store.cs namespace Bdd.Store { public class Store { public Product FindByProductName(string name) { Product product = new Product { Name = name }; return product; } } } Purchase.cs namespace Bdd.Store { public class Purchase { public Product Product{ get; set; } public int Licenses { get; set; } public bool IncludesSupport { get; set; } public double GetTotalPurchasePrice() { double price = Product.Price * Licenses; double supportFees = 0.0; if(IncludesSupport) { supportFees = price * 0.10; } return price + supportFees; } } } I then compiled these into an assembly called Product.dll using the CSharp compiler command (run from my Visual Studio Command window): csc /out:Product.dll /target:library Product.cs Store.cs Purchase.cs I then required my Product.dll into my step definitions file (product_steps.rb) require File.dirname(__FILE__) + "/Product.dll" Just as a convenience, I "include" my Bdd.Store namespace: include Bdd::Store I also require RSepc require "rspec" Lastly, I begin implementing my steps: Given /^Product (.*)$/ do |product| @store = Store.new @product = @store.find_by_product_name(product) @product.price = 250; @product.name.should == product end and so on and so forth. You can download my files from http://webcoding4fun.oakraven.net/downloads/BDD Example with CSharp.zip<http://webcoding4fun.oakraven.net/downloads/BDD%20Example%20with%20CSharp.zip> I hope this helps a little. Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20101129/97161f65/attachment.html>
Mike Hatfield
2010-Nov-29 21:42 UTC
[Ironruby-core] no such file to load -- spec/story (LoadError)
Sorry Sundae, I had a type-o on the Cucumber version. try: igem install cucumber -v=0.6.4 It''s 0.6.4, not 1.6.4. Again. Apologies. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20101129/2bd02628/attachment-0001.html>
Sundae Oliseh
2010-Nov-30 16:50 UTC
[Ironruby-core] no such file to load -- spec/story (LoadError)
No need to apologize at all Mike. In any case, I should apologize to you for taking so much of your time. I have some good news to report...It''s finally working. I was able to run your script without any problem. Thank you so much for all the help and patience. Cory, Shay..thank you too. It took us 3 days but we did it. Cheers! -- Posted via http://www.ruby-forum.com/.
Mike Hatfield
2010-Nov-30 18:06 UTC
[Ironruby-core] no such file to load -- spec/story (LoadError)
That''s great to hear Sundae. Glad to help. I learned a bit myself. :) -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20101130/019853e9/attachment.html>