Skip to content

Instantly share code, notes, and snippets.

public class Menu : Entity
{
public virtual IList<Course> Courses { get; set; }
public virtual DateTime? LockDate { get; set; }
public virtual ReviewState State { get; set; }
public virtual MenuTitle Title { get; set; }
public virtual MenuPrice Price { get; set; }
public virtual MenuAvailability Availability { get; set; }
public virtual MenuDeposit Deposit { get; set; }
public virtual MenuCancellationFee CancellationFee { get; set; }
build = msbuild :msbuild do |msb|
msb.properties :configuration => @env.local? ? :Debug : :Release, :outdir => @env.output_dir
msb.targets :Clean, :Build
msb.solution = @env.root + '/' + @env.solution
msb.verbosity = @env.debug? ? :normal : :quiet
if @env.teamcity?
msb.parameters "/l:JetBrains.BuildServer.MSBuildLoggers.MSBuildLogger,#{@env.tools.msbuild_logger}"
end
end
build = msbuild :msbuild do |msb|
msb.properties :configuration => @env.local? ? :Debug : :Release, :outdir => @env.output_dir
msb.targets :Clean, :Build
msb.solution = @env.root + '/' + @env.solution
msb.verbosity = @env.debug? ? :normal : :quiet
if @env.teamcity?
msb.parameters "/l:JetBrains.BuildServer.MSBuildLoggers.MSBuildLogger,#{@env.tools.msbuild_logger}"
end
end
if (_pageTitle != null && !string.IsNullOrEmpty(_pageTitle))
{
}
else
{
_pageTitle = GetPhrase("PageTitle");
}
if (Master != null)
{
class Mock
def initialize(properties)
@properties = properties
end
def method_missing(m, *args, &block)
@properties[m]
end
end
Feature: Example
So that I can understand how to use cucumber and capybara
As a developer
I want some example scenarios
Scenario: I correctly fill in the form
Given I am on the test page
And I set "Name" to be "Foo"
When I click "Submit"
Then the page should show "Foo"
#The sentance "Given I am on the test page" is mapped to the following
#ruby code block using a regular expression
Given /^I am on the test page$/ do
visit '/test.aspx'
end
#commands
visit 'some/page'
click_link 'Some link'
fill_in 'Name', :with => 'John'
select 'Some Option', :from => 'Select'
choose 'A Radio Button'
check 'A Checkbox'
#assertations
describe "Ruby books", :ruby_books do
create_a :book
.named :rspec
.title "The RSpec Book: Behaviour Driven Development with Rspec, Cucumber, and Friends"
.cost 21.75
create_a :book
.named :programming_ruby
.title "Programming Ruby 1.9: The Pragmatic Programmers' Guide"
.cost 21.10
Feature: Book recommender
So that we can sell more books
As a business
I would like to recommend books which a customer might want to buy
Scenario: A ruby enthusiast wants a book
Given there is a "ruby enthusiast" #the step definiton will then call the :ruby_enthusiast code blog
When I ask for a recommended book
Then I should be recommended "Continuous Delivery: Reliable Software Releases Through Build, Test, and Deployment Automation"